Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

[SOLVED] How can I add an "if on homepage" condition in sub template?


 
Prev Previous Post   Next Post Next
  #1  
Old Apr 25, 2013, 10:06 AM
Bassquake
 
2 posts · Apr 2013
Exclamation [SOLVED] How can I add an "if on homepage" condition in sub template?

Im trying to add an if statement into the header.php which is the sub template of Montezuma.

Ive tried adding at the end of header.php:

Code:
<?php
if ( is_front_page() ) {
    echo "Home";
} else {
    echo "Away";
}
?>
But it doesnt show anything. It works if I hardcode it in head.php so I know the code works.

Ive tried adding a wp_reset_query but that didnt work.

Are conditionals stripped out in virtual templates? If so, how can I add one in?

Kind regards.
 

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a template for a static homepage RichardG Forum How-To 10 Sep 15, 2010 04:49 PM
KICKER: Homepage %category-linked"% causes right sidebars to disappear from homepage Jazoja Post-Kicker, -Byline & -Footer 2 Jun 23, 2010 05:32 PM


All times are GMT -6. The time now is 01:46 AM.


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