I Have been trying to get a different header image on each page this is what I have come up with http://pastebin.com/aW2FmVWi. I used a If is(front_page) then used elseif is_page(permalink for page) for all the pages that I wanted different images then closed with a else statement thinking that this would suffice ALL other pages except the ones that I specified above. This worked great until I got to the pages that have a parent or are a parent, then all my pages are except posts are called by
<div id=”<?php echo $post->post_name; ?>”>
<img src=”<?php bloginfo(‘template_url’); ?>/headers/header_<?php echo $post->post_name; ?>.jpg” />
so I have a page to test my designs and plugins call /test it is not referenced in any of my code but the header image that is being pulled is called header_test.jpg when is should be header_1.jpg
I am new to php so you might want to dumb everything down tho any help is appreciated
- The topic ‘Problem with Conditional Statements in header for parent pages’ is closed to new replies.