• Resolved radovleugel

    (@radovleugel)


    With the help of this support forum and my own creativity I managed to get a different header for every category. There remains one problem the main page gets the header of the last post. My question is, what do I have to change in the following code to get a a€?stickya€? header for the main page (index.php)?

    <?php wp_head(); ?>
    </head>
    <body>
    <? $post = $wp_query->post;
    if ( in_category(‘1’) ) {
    include(“c1.php”);
    } elseif ( in_category(‘1’) ) {
    include(“c2.php”);
    } else {
    include(“c0.php”);
    } ?>

    Your help is highly appreciated.

    Greetings,
    Rado Vleugel
    The Netherlands

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try changing the if/else statement to:

    if( is_home() {
    include("top.php");
    } else {
    if ( in_category('1') ) {
    include("c1.php");
    } elseif ( in_category('1') ) {
    include("c2.php");
    } else {
    include("c0.php");
    }
    }

    Just make sure there’s a top.php, or change that above to the one used for your home page header.

    Thread Starter radovleugel

    (@radovleugel)

    Totally forgot to thank youa€|
    Thanks a lot for solving this problem!

    Rado Vleugel

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different header for every category problem’ is closed to new replies.