| PHP / WordPress Help with the IF statement |
giggle

msg:4421646 | 10:48 am on Feb 25, 2012 (gmt 0) | Hi I have a piece of code in a WordPress theme that I'd like some help with, please.
<?php if (is_page('ThisPage')) { include (TEMPLATEPATH . '/HeaderResults.php'); } else { wp_get_header(); } ?>
<div class="art-contentLayout"> <?php include (TEMPLATEPATH . '/sidebar1.php');?>
I would only like the last two lines executed if the page selected is not ThisPage. I've searched the web and tried all sorts of variations but I cannot get any to work. Help! Also, how do I substring a page name to see if it starts with the string "STARTSWITHTHIS"? Thanks Mick
|
RonPK

msg:4422235 | 1:16 pm on Feb 27, 2012 (gmt 0) | You'll need to jump out of PHP parsing at the right spot in the else condition:
<?php if (is_page('ThisPage')) { include (TEMPLATEPATH . '/HeaderResults.php'); } else { wp_get_header(); ?> <div class="art-contentLayout"> <?php include (TEMPLATEPATH . '/sidebar1.php'); } ?>
|
|
|