• I would like to have a different header for each category. I was able to create conditional sidebars with each category (using include)…

    <?php
    $post = $wp_query->post;
    if (in_category('3')) { 
    
     include(TEMPLATEPATH . '/sidebar3.php');
    
    } elseif (in_category('4')) {
    
    include(TEMPLATEPATH . '/sidebar4.php');
    
    } else {
    
    include(TEMPLATEPATH . '/sidebar_post.php');
     }
     ?>

    now I would like to do it with the header, but I’m not sure how to do it with the get_header function. Can someone help? I don’t want to mess things up. Can I just use include?

    I also want to use different headers with different pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The same way as you did with the sidebar and for the last ‘else’ you call the generic header
    else {
    get_header();

    I assume you are doing all the above code and stuff in a category.php template file.

    Or, alternatively, you could do it inside header.php

    with IF IN CATEGORY 3… DO THIS STUFF…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional Header (based on posts category or page template) – How?’ is closed to new replies.