Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22370

    Hoping for a bit of direction. I looking to have a different header.php file presented depending on the Page id. I assumed some code added to the get_header tag in the template-dynamic.php file with an array would work but not having any luck. Can you provide any support for this? I understand its above and beyond theme support but you guys are always pretty great with a helpful hand.

    #115560

    Please read: http://codex.wordpress.org/Function_Reference/get_header

    Basically you need to combine the get_header tag with templates and conditions – eg create two files:

    header.php and header-special.php and in template-dynamic.php and page.php replace

    get_header.php()

    with

    if ( is_page(array(42, 50)) ) :
    get_header( 'special' );
    else :
    get_header();
    endif;

    #115561

    Thanks dude. I had it except I was only updating the template file. Also updating the page file did the trick. Thanks as always for your great support!

    #115562

    Glad Dude could help :)

    Let us know if you have any other questions or issues.

    Regards,

    Devin

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Conditional header file depending on page ids’ is closed to new replies.