Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] Display page title at top of center column (http://forum.bytesforall.com/showthread.php?t=12721)

jbrown13 Feb 9, 2011 07:11 PM

[SOLVED] Display page title at top of center column
 
Greetings...

My site is http://cslgc.org, and I'm using Atahualpa 3.5.2 (yes, I'll upgrade soon). The home page is set to a static page, and the blog entries are displayed on a page titled "CSL Blog"; its slug is "csl-blog". I want to display the title of this page at the top of the center column.

I've tried adding

Code:

<?php if ( is_page('CSL Blog') ) {echo 'CSL Blog' ; } ?>
to ATO > Style and edit CENTER COLUMN > Content ABOVE the LOOP. Nothing displays.

What have I done wrong, please?

Thanks...

JGB

jbrown13 Feb 10, 2011 05:16 AM

Okay, I've done some experimenting, and the problem is a little more specific now. I tried this same trick for a different page, adding the following code in ATO > Style and edit CENTER COLUMN > Content ABOVE the LOOP:

Code:

<?php if ( is_page('Directions') ) {echo "#" ; } ?>
This displays a hash mark at the top of the center column of my Directions page.

The problem thus seems limited to my posts page. Something in the way that page is handled overrides any changes I make to the pre-loop code.

How can I display a title at the top of the center column of my posts page?

Thanks...

JGB

jbrown13 Feb 10, 2011 05:43 AM

Ha! Solved it.

Per the Wordpress Codex entry on Conditional Tags:
Quote:

is_home() : When the main blog page is being displayed. This is the page which shows the time based blog content of your site, so if you've set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the "Posts page" in Administration > Settings > Reading.
Therefore, the code to put in ATO > Style and edit CENTER COLUMN > Content ABOVE the LOOP is

Code:

<?php if ( is_home() ) {echo '<div class="post-headline"><h1>CSL Blog</h1></div>' ; } ?>
And it works.

JGB


All times are GMT -6. The time now is 02:58 PM.

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