• Hi,
    I am using a child-theme of TwentyTwelve – twentytwelve-child. I want to use a different header on my contact page. I am using this code at the top of my page.php file:

    wp_reset_query();
    if (is_page(‘Contact’)) {
    get_header(‘contact’);
    } else {
    get_header();
    }

    As you can see, if I’m on the Contact page, it should use the header-contact.php file. I’ve created header-contact.php and referenced a different header image in that file.

    Unfortunately, it doesn’t work. I’ve tried deactivating all plugins. As you can see, I’ve also tried adding wp_reset_query() before the conditional tag code, because I heard that might be necessary. It still doesn’t work.

    Does anyone have any clues? Here is the page: https://webscript2wp.com/contact/

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • your ‘contact’ page is using the page template /page-templates/full-width.php – i.e. page.php is not used and can therefore not trigger a different header.

    possibly try to use the conditional code in header.php to wrap the header image code.

    Thread Starter kdebruine

    (@kdebruine)

    THANK YOU…thank you…THANK YOU!! I spent hours trying to figure that out and it was a simple mistake on my part.

    It works now, because I changed the page template for the Contact page to the default template. ??

    Lesson learned!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional Tag not working’ is closed to new replies.