Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   How to Remove Page Title in Page Body (http://forum.bytesforall.com/showthread.php?t=1334)

davidferris Apr 19, 2009 02:32 PM

How to Remove Page Title in Page Body
 
Hi there,

First, I love the theme and made a $50 donation a few weeks ago. Now that I'm perusing the Forum I realize that you might not have linked the donation with my name. How do I do that?

Now, the question: I want to remove the page title from the body of my pages. I've cruised all over the Theme Options but can't see how to do this. How can it be done?

Site is at:
http://theferrisfiles.com

Thanks,

David

Flynn Apr 20, 2009 09:54 PM

Thank you for your donation, David. I added it to your user name.

To remove the page title edit index.php and replace

PHP Code:

         <!-- Post Headline -->                    
        <div class="post-headline">    
        <h2><?php 
        
if( !is_single() AND !is_page() ) { ?>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 
            
if (function_exists('the_title_attribute')) { 
                
the_title_attribute();
            } 
            elseif (
function_exists('the_title')) { 
                
the_title();
            } 
?>"><?php 
        
the_title(); 
        if( !
is_single() AND !is_page() ) { ?>
            </a><?php 
        
?>
        </h2>
        </div>



with

PHP Code:

<?php if ( !is_page() ) { ?>
        <!-- Post Headline -->                    
        <div class="post-headline">    
        <h2><?php 
        
if( !is_single() AND !is_page() ) { ?>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 
            
if (function_exists('the_title_attribute')) { 
                
the_title_attribute();
            } 
            elseif (
function_exists('the_title')) { 
                
the_title();
            } 
?>"><?php 
        
the_title(); 
        if( !
is_single() AND !is_page() ) { ?>
            </a><?php 
        
?>
        </h2>
        </div>
<?php ?>



d_random Apr 23, 2009 01:14 PM

This worked perfectly, thanks Flynn!! :)

krystyna Apr 25, 2009 05:50 AM

I did this and it worked BUT I think I'd prefer to have the page title removed from just the static home page.

URL is http://www.sangabrielmission.net

Thanks!

Flynn Apr 25, 2009 08:43 AM

Then use

PHP Code:

<?php if ( !is_front_page() ) { ?>
        <!-- Post Headline -->                    
        <div class="post-headline">    
        <h2><?php 
        
if( !is_single() AND !is_page() ) { ?>
            <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php 
            
if (function_exists('the_title_attribute')) { 
                
the_title_attribute();
            } 
            elseif (
function_exists('the_title')) { 
                
the_title();
            } 
?>"><?php 
        
the_title(); 
        if( !
is_single() AND !is_page() ) { ?>
            </a><?php 
        
?>
        </h2>
        </div>
<?php ?>


davidferris Apr 27, 2009 12:40 PM

Worked perfectly, Flynn, thanks!

pctechb May 11, 2009 09:06 AM

Did this change in 3.33? I need to remove the title in the Pages only.

I somehome managed to do it in 3.32, but I can't recall how.

Flynn May 11, 2009 02:51 PM

Shouldn't be different. It looks different from 3.3.4 on

pctechb May 11, 2009 05:23 PM

Hmmmm. Compared to 3.32, the index.php file is different and does not contain that same code. Or maybe I've been looking at it too long. Can you confirm that I am blind?

Flynn May 11, 2009 07:23 PM

It may not be identical, but the changes were bigger from 3.3.4 on

pctechb May 11, 2009 08:23 PM

In functions/post-parts.php I found this--which is close:

function bfa_post_headline()
{


global $bfa_ata;
?><div class="post-headline">
<h<?php echo $bfa_ata['h_posttitle']; ?>><?php
if( !is_single() AND !is_page() ) { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
if (function_exists('the_title_attribute')) {
the_title_attribute();
}
elseif (function_exists('the_title')) {
the_title();
} ?>"><?php
} the_title();
if( !is_single() AND !is_page() ) { ?>
</a><?php
} ?>
</h<?php echo $bfa_ata['h_posttitle']; ?>>
</div><?php
}


If this is the correct area, what would we change here to eliminate the title on static pages?

Flynn May 11, 2009 10:28 PM

Sorry, you're right. I keep referring to 3.3.4 which is not even released yet. In the current version 3.3.3 change in index.php
PHP Code:

            <?php bfa_post_kicker(); // Post Kicker: To edit the output, see functions/bfa_post_parts.php ?>

            <?php bfa_post_headline(); // Post Headline: To edit the output, see functions/bfa_post_parts.php ?>

            <?php bfa_post_byline(); // Post Byline: To edit the output, see functions/bfa_post_parts.php ?>

to
PHP Code:

<?php if ( !is_front_page() ) { ?>
            <?php bfa_post_kicker(); // Post Kicker: To edit the output, see functions/bfa_post_parts.php ?>

            <?php bfa_post_headline(); // Post Headline: To edit the output, see functions/bfa_post_parts.php ?>

            <?php bfa_post_byline(); // Post Byline: To edit the output, see functions/bfa_post_parts.php ?>
<?php 
?>

Or use !is_page() instead of !is_front_page() to do this for all static pages

Alternatively you can create a home.php (for the front page) or a page.php (for all static pages) and delete those 3 lines in these new files, and upload them to the theme's root directory, i.e. /wp-content/themes/atahualpa333/

pctechb May 12, 2009 04:18 AM

Thanks. That did the trick. You would think this would be a Wordpress option and not, necessarily, a theme option.

I have one other Q, but I'll start a new thread. Thanks!

cdrice May 31, 2009 06:22 PM

Just wanted to say thanks for this also -- this is precisely what I came looking for today!

I might be nice to have this as an option we can provision from the themes options in some future release -- but this certainly works perfectly for me.

Thanks!

Thalie Jun 21, 2009 09:16 AM

Thank you, worked perfectly on 3.3.3.

pushkinpassey Jul 1, 2009 06:16 PM

Hi Flynn,

How can I do this for specific pages in 3.3.3?

Thanks!
Pushkin

Flynn Jul 1, 2009 08:01 PM

Use

PHP Code:

<?php if ( is_page('Page Title') ) { ?>
....
<?php ?>

or, to make the condition "If this is not the page with the title...":

PHP Code:

<?php if ( !is_page('Page Title') ) { ?>
....
<?php ?>

For several pages

PHP Code:

<?php if ( is_page(array('Page Title''Other Page Title')) ) { ?>
....
<?php ?>

or respectively

PHP Code:

<?php if ( !is_page(array('Page Title''Other Page Title')) ) { ?>
....
<?php ?>


mmorneau Jul 23, 2009 08:39 PM

So how would I do this for 3.3.4? I've tried doing it from:

Dashboard
> Edit Pages
> [PAGE NAME]
> Atahualpa Page Options
> "Check to NOT display the Body Title on Single Post or Static Pages"

...but the page titles keeper appearing and I cannot locate the php code snippets shown above anywhere.

And yes, I'm a n00b. :o

jack96161 Jul 26, 2009 12:37 PM

Hi,

I too want to remove page titles from page bodies, but trying to follow the advice given here, I feel a bit foolish because I can't find any of the code that needs to be replaced in the index.php file for Atahualpa 3.3.3 -- has something major been changed since this question was answered?

Jack

jack96161 Jul 26, 2009 03:46 PM

OK, in addition to foolish, I now feel stupid -- I failed to carefully read ALL of this thread. Post #12 answered this question - and it works! Sorry and thanks...

Jack

bobskinner Jul 29, 2009 09:46 AM

Please forgive me if I am missing something.

I just installed Wordpress yesterday and this amazing theme. I have read this thread but have been unable to find the text to replace in my Wordpress admin area to remove titles from all my pages and posts. I looked in: Appearance > Editor at index.php but there is nothing that resembles the above code.

Is there a different way to remove all titles in Atahualpa v3.4.1?

Thank you in advance for any assistance in this regard.

Bob

Gnopps Aug 20, 2009 12:16 PM

I am just starting with this great, great theme but can't find how to change it either. There is nothing of that code in index.php, so it must have been changed.

So how do I go about removing titles from all static pages in version 3.4.1?

Thank you for your help!

Edit:

I found it has been moved now. The needed code can be found in Options->Style & Edit Center Column

mkhobson Aug 21, 2009 01:53 AM

OK, I'm trying to implement some of the suggestions here and am running into a brick wall. On my site, I want headers to appear on one page only - the journal page. I went to the "Style and Edit Center Column" tab and under "The Loop" code I cobbled this together:

<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php if ( is_page('journal') ) { ?>
<?php bfa_post_kicker(); ?>
<?php bfa_post_headline(); ?>
<?php bfa_post_byline(); ?>
<?php } else { ?>
<?php bfa_post_kicker(); ?>
<?php bfa_post_byline(); ?>
<?php } ?>

<?php bfa_post_bodycopy ... etc, etc.


I'm saying if the page is 'journal', then show all three, else show only 2 ... (sans header) ... right? Obviously I'm pretty weak at the PHP. Help!

Thanks,
Mary

juggledad Aug 21, 2009 04:28 AM

Does the page title match exactl? Case/extra spaces? you can use the id instead - ex. is_page('34')
what error to you get?

mkhobson Aug 21, 2009 09:26 AM

I went back and tried using the page #, and no luck that way either.

Here's the link, in case it helps at all: http://www.demimonde.com/blog -- I want page titles ONLY on the Journal page.

Thank you!

M

mkhobson Aug 21, 2009 11:31 PM

Also, Juggledad, to answer your question, I get no error message ... it's just the titles are there or they're not.

If I go to "Style & Edit Center Column" and comment out the call to post headline (like so):

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<!--<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>-->
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

Then page titles are turned off throughout the site. This would be fine, but it also turns off the titles of all the journal posts on http://www.demimonde.com/blog/?page_id=48, which is the only page I *want* them to be turned on!

I have looked through just about every thread there is on this topic and it's driving me cuckoo. Thanks in advance for your assistance!

M

mkhobson Aug 24, 2009 10:59 AM

Bump! Still looking for answers to this seemingly-intractable riddle. Help!

Flynn Aug 27, 2009 08:49 AM

In version 3.4.2 add the red parts

<?php if ( is_page('journal') ) { ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
<?php } ?>

... and remove everything you added before.

If this doesn't work make sure:
  • You aren't getting a cached copy of your site, either from a WP cache (WP Super Cache, WP Cache 2, or others) or a browser cache, or a server wide cache
  • You have the right page slug (journal), page title (Journal) or page ID (13). (These are just examples). You can use either of these 3, but it needs to match.

mkhobson Aug 27, 2009 05:36 PM

Hi Flynn:

Thank you so much for looking into this. However, I tried the code you provided and it did not seem to help.

I cut and pasted the code directly from your post. The page title is "Journal" and the page id (in the URL) is "journal". I tried both of these as variables and neither one worked.

I viewed the page on 3 different computers in the house to rule out cache issues.

Note that if you go to the page now (http://www.demimonde.com/journal/) you will see headers because I have inserted them manually (using an H3 at the top of the post, and manually linking it to the permalink). This is a reasonable workaround, but when I cross-post to LiveJournal, it results in me having a "Header" (which doesn't appear on my actual journal page) and a "subheader" (which is the "header" that shows on my journal page.)

It's all very complicated and strange.

Any other thoughts?

Thanks again,
Mary

mkhobson Aug 27, 2009 05:38 PM

For reference, here's how it looks in LiveJournal -- note the "header/subheader"

http://mkhobson.livejournal.com/

twola Sep 11, 2009 04:21 PM

This is how I removed my page headings:

PHP Code:

<?php if ( !is_page() ) { ?>
<?php bfa_post_headline
('<div class="post-headline">','</div>'); ?>
<?php 
?>

//translated to: If it is not a page only than show headings.


Good luck

lyd753 Dec 12, 2011 12:59 PM

Spent an hour searching for this fix last time and it happened again with this upgrade

Needed to comment to be able to find this post next time. Works perfect

- thank!

juggledad Dec 12, 2011 02:10 PM

You can also do it with CSS
HTML Code:

body.page .post-headline {display: none;}
then it is a theme option and you don't have to change it on upgrades.

jtown Dec 26, 2011 09:36 PM

hello and thanks in advance
I am new to this theme and to site building
So I was hoping you might be able to help me with were to add the PHP code or were I can go to learn more
thanks
Justin

juggledad Dec 27, 2011 03:41 AM

Try the CSS solution and put it in ato->add HTML/CSS inserts->CSS inserts

counteverythingasloss Jan 3, 2012 01:09 PM

THANKS! This was SUPER helpful!


All times are GMT -6. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.