[resolved] trouble calling different header.php for home.php (3 posts)

  1. alexisfrsh
    Posted 3 years ago #

    I'm making a site that uses the same header.php for all pages except the blog/home.php. For this, I've created blog-header.php and am attempting to call it using the following:

    <?php if( is_page(15) ) {
    echo get_template_part( 'blog', 'header' );}
    else {
    echo get_header(); } ?>

    However, it doesn't seem to be working. Any ideas on why that may be?

    (Unfortunately, the site isn't live yet otherwise I'd provide a link.)

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Rename the file header-bog.php and use <?php get_header( 'blog');?>

  3. alexisfrsh
    Posted 3 years ago #

    What a life-saver, thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic