1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

[ask] How to show a specific banner in a specific post?

Discussion in 'Blogging' started by gr33n, Oct 29, 2009.

  1. gr33n

    gr33n Power Member

    Joined:
    Oct 22, 2007
    Messages:
    513
    Likes Received:
    251
    Gender:
    Male
    Location:
    Ro
    On my blog I have 4 category and in each category 3 posts.How can I display a specific banner for "category 1" on all posts in that category,another banner for "category 2" to all my posts in that category and so on?I want to do this for the banner in the header and for the onde in sidebar.I managed to show a specific banner in every category with the code below ..but when i go to any post in that category i get the general banner.

    Code:
    <?php if (is_category('golf-clubs')) { ?>
    
    <<insert html code for golf club ads>>
    
    <?php } elseif (is_category('golf-balls')) { ?>
    
    <<insert html code for golf balls ads>>
    
    <?php } elseif (is_category('golf-tips')) { ?>
    
    <<insert html code for golf tips ads>>
    
    <?php } else { ?>
    
    <<any other html code to show for undefined categories>>
    
    <?php } ?>