• Hi everyone,
    have a question how to implement different headers for different categories?
    Right now I have the following (I have created 4 php files for headers and added this lines to the archives.php, single.php, index.php):
    <?php
    if (in_category(‘hopes’)) {
    include (‘header-hopes.php’);
    }
    elseif (in_category(‘memories’)) {
    include (‘header-memories.php’);
    }
    elseif (in_category(‘dreams’)) {
    include (‘header-dreams.php’);
    }
    else {
    include (‘header.php’);
    }
    ?>
    but this doesn’t work, I have only header.php included everywhere. Have no clue as I’m not good in php.
    I need only this 3 to be different. The function is_category or the method of creating special category-6 or sth do not work as I need EVERYTHING that is assigned to the category (including single posts and lots of subcategories in it) to have a certain header and style.css that is written there.

    Any ideas how to do this?

  • The topic ‘different style header.php files for different categories’ is closed to new replies.