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

How to do this?

Discussion in 'Blogging' started by lhurey, Mar 20, 2010.

  1. lhurey

    lhurey Registered Member

    Joined:
    Sep 30, 2009
    Messages:
    83
    Likes Received:
    219
    Is this the right code how to display ads on specific categories on wordpress?
    Code:
    <?php if (in_category('category-slug-1')) { ?>
    your ad code for category 1
    <?php } elseif (in_category('category-slug-2')) { ?>
    your ad code for category 2
    <?php } elseif (in_category('category-slug-3')) { ?>
    your ad code for category 3
    <?php } else { ?>
    leave blank or insert general ad code for categories not determined above
    <?php } ?>
    
    BUT

    How to do this on pages like www*domain*com/about-us/ and
    www*domain*com/about-us/contact-us