Support » Fixing WordPress » Problem with Conditional Statements in header for parent pages

  • Hello,


    I Have been trying to get a different header image on each page this is what I have come up with 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


Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for the post SwansonPhotos,

    I read through it and it looks like if I have no other choice I would go down this road but right now I can make the code I have work by adding the header images named header_”page title” … I just wanted help troubleshooting why I can’t get certain pages to revert to what I am setting as default or else.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with Conditional Statements in header for parent pages’ is closed to new replies.