1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

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

  1. gr33n

    gr33n Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2007
    Messages:
    501
    Likes Received:
    243
    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 } ?>