|
#1
Aug 26, 2009, 02:56 AM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
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?
|
#2
Aug 27, 2009, 06:51 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
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)
|
#3
Aug 27, 2009, 07:10 PM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
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
|
#4
Aug 27, 2009, 07:36 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
is the journal page set as the 'blog' page in wordpress dashboard->settings->reading?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#5
Aug 27, 2009, 07:40 PM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
Yes. The site has a static home page (Home) and the posts page is Journal.
Thanks,
Mary
|
#6
Aug 27, 2009, 08:14 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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??
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#7
Aug 27, 2009, 10:03 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
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')
|
#8
Aug 27, 2009, 11:24 PM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
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
|
#9
Aug 27, 2009, 11:56 PM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
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?
|
#10
Aug 28, 2009, 06:49 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
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>'); ?>
|
#11
Aug 28, 2009, 07:05 AM
|
|
|
26 posts · Aug 2009
Oregon City, OR
|
|
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
|
#12
Sep 7, 2009, 12:09 PM
|
|
|
22 posts · Jun 2009
Tupelo, MS
|
|
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
|
|