Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Customization, Design, Programming... (http://forum.bytesforall.com/forumdisplay.php?f=22)
-   -   Help me figure out how to turn off page titles on one page only (http://forum.bytesforall.com/showthread.php?t=3146)

mkhobson Aug 26, 2009 01:56 AM

Help me figure out how to turn off page titles on one page only
 
Meet my blog:
www.demimonde.com/blog

The Problem To Be Solved:
I want page titles to appear on only ONE page of the whole blog--the page called "Journal", which is page_id '48'. On all other pages, there should be no titles.

Background Information:

According to http://forum.bytesforall.com/showthread.php?t=1334, accomplishing this seemed to be easy in versions prior to 3.4.1. Several commenters (from about post 21 on) asked how to solve this problem in 3.4.1, and no one has come up with any answers. The key to solving the problem seems to be in Appearance>Atahualpa Theme Options>"Style & Edit Column" tab. In the "The Loop" box, commenting out the "bfa_post_headline" function results in all the headlines being turned off sitewide. So far so good. However, nothing else I've tried to implement an "if/else" solution (so that page 48, and ONLY page 48 has titles turned on) has worked. Here is the code I cobbled together:

<?php if ( is_page('48') ) { ?>
<?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 } else { ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
<?php } ?>

I'm wondering if the solution will have to go all the way down to an edit of the bfa_post_parts.php file, where the post_header function is defined, but given that my PHP skills are lousy, I'd need help with that.

So. Any takers? How much?

Flynn Aug 27, 2009 05:51 PM

The else part is not needed, try

<?php if ( is_page('48') ) { ?>
<?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 } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

Make sure you're using the right page ID, and that you aren't seeing cached pages (Wp Cache, Browser cache, etc)

mkhobson Aug 27, 2009 06:10 PM

Hi Flynn:

Still no luck, even with the new code. I tried 3 different variables: 'journal', 'Journal', and '48'

I'm clearing the browser cache between each refresh using Firefox's "Clean Sweep" button.

Thanks,
Mary

juggledad Aug 27, 2009 06:36 PM

is the journal page set as the 'blog' page in wordpress dashboard->settings->reading?

mkhobson Aug 27, 2009 06:40 PM

Yes. The site has a static home page (Home) and the posts page is Journal.

Thanks,
Mary

juggledad Aug 27, 2009 07:14 PM

When the dashboard->settings->reading->Front page displays->A static page (select below) is checked and the 'Posts page:' points at a page (let's call it 'Journal'), the '<body' in the source looks like this
HTML Code:

<body class="blog logged-in">
and is_page() returns null

BUT

when the dashboard->settings->reading->Front page displays->Your latest posts is checked and you go to the page 'Journal', the '<body...>' looks like this
HTML Code:

<body class="page page-id-80 page-template page-template-default logged-in">
is_page() returns 1

Is this a wordpress bug??

Flynn Aug 27, 2009 09:03 PM

That's possible, good find. Or it may be intended that way.

@Mary: So, if this is the blog posts home page, try with is_home() instead of is_page('something')

mkhobson Aug 27, 2009 10:24 PM

Success! Hooray!

For future reference (and crossposting to the original thread), here is the successful code:

<?php if ( is_home() ) { ?>
<?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 } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

Thank you both so much! Another donation is winging its way to you for your excellent support of this brilliant theme.

Mary

mkhobson Aug 27, 2009 10:56 PM

Wait a minute ... spoke too soon. One additional issue. Headers are now showing on the "Journal" page, but when you click on a permalink for the actual post (e.g. http://www.demimonde.com/2009/08/27/...r-bfa/#respond) the page header doesn't show up there.

Thoughts?

Flynn Aug 28, 2009 05:49 AM

So you want headlines on this particular single post page, or on all single post pages? You mentioned that you want headlines only on the Journal page.

Single post pages are is_single()

<?php if ( is_home() OR is_single('hooray-hooray-for-bfa') ) { ?>
<?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 } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

or, for all single post pages

<?php if ( is_home() OR is_single() ) { ?>
<?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 } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

mkhobson Aug 28, 2009 06:05 AM

Hi Flynn:

Your way is easier and more elegant than what I figured out, which was this:

<?php if ( !is_page(array('Home', 'About', 'Biography', 'Bibliography', 'Appearances', 'Novels', 'The Native Star', 'The Desired Poison', 'Stories', 'The Hotel Astarte', 'Domovoi', 'Hell Notes', 'Podcasts', 'Articles', 'Press', 'Interviews', 'Press Kit', 'Contact' )) ) { ?>
<?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 } ?>
<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

... But both ways work. I think I'll go with your way, though. ;-)

Thank you again!

Mary

TwtrCoach Sep 7, 2009 11:09 AM

Not sure if I need to add this in again.

Added it in once. Then it looked like there was options under the pages to adjust your settings. So I took it out again. Now I removed all my headers. Tried to reinstall ver 3.4.2 again. But nope. So is back to 3.3.3 again.. Did only want headers for pages turned off, not all my headers.

Well, I try again later on..

Cheers.. Are


All times are GMT -6. The time now is 10:23 AM.

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