Specific Header Image for specific Category archive page… How??

  • sghegde87



    There are 6 Categories in my website. I have made each category archive to be a separate page.

    Now, How do I set a different banner (header) image for each one of them??? Not the Random way.. I want a specific header image on each Category archive..

    For Ex:

    Category archive 1:- Banner1

    Category archive 2:- Banner 2



    Category archive 6:- Banner 6.

    Pardon me if this has been answered somewhere. Searched it but couldn’t find…



    Try something like this,

    function graphene_custom_category_header_img($header_img) {
    if( is_category() ) {
    $cat_ID = get_query_var('cat');

    switch( $cat_ID ) {
    case 12: $header_img = 'http://path_to_image_for_category_ID_12.jpg';

    case 23: $header_img = 'http://path_to_image_for_category_ID_23.jpg';

    case 34: $header_img = 'http://path_to_image_for_category_ID_34.jpg';
    return $header_img;
    add_filter( 'graphene_header_image','graphene_custom_category_header_img');

    You need to find out the ID of all the categories and then put it in switch case. Then change header image path with the one you want to use with that category archive page.



    Genius!! Works like a charm man…. Works like a CHARM!!! Really impressive and appreciable…. Thanks a lot…

    Marking this as resolved…..

Viewing 3 posts - 1 through 3 (of 3 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum