• Resolved mhb

    (@mhb)


    My case: I have 5 static pages, one of them is a front page and another (mhblog) is set it up as posts page. That’s the problem.
    I can’t change the header of this page.
    I’ve tried creating a template that calls a proper header and I’ve tried also some conditional.
    For example:
    <?php
    if (is_page(‘mhblog’)){
    include(TEMPLATEPATH.’/header2.php’);
    }
    else {
    include(TEMPLATEPATH.’/headerdefault.php’);
    }
    ?>
    This not worked, because mhblog page is set as posts page. If I uncheck this option in reading settings it works.
    Who can <<please>> help me to discover the secret?
    –> https://www.mhbd.com.br

Viewing 1 replies (of 1 total)
  • Thread Starter mhb

    (@mhb)

    As a “not coder human” I’m really happy!
    Finally I found the solution:
    <?php
    if (have_posts()&&!is_page(‘title_page1’)&&!is_page(‘title_page2’)&& //… and so on//{
    include(TEMPLATEPATH.’/header2.php’);
    }
    else {
    include(TEMPLATEPATH.’/headerdefault.php’);
    }
    ?>
    Thanks to https://blogcrafted.com/wordpress-php-conditional-tags/
    I hope this can help somebody.

Viewing 1 replies (of 1 total)
  • The topic ‘Different header again’ is closed to new replies.