Problem with Conditional Statements in header for parent pages (3 posts)

  1. TPConline
    Posted 3 years ago #


    Website: tooklandpentecostalchurch.org

    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


  2. Pioneer Web Design
    Posted 3 years ago #

  3. TPConline
    Posted 3 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Topic