WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] is_single & is_category? (4 posts)

  1. ianbee
    Member
    Posted 1 year ago #

    I'm trying to show elements only on single posts, in a specific category. Is there any way of doing this?

    So id want an ad to show up on my website only for the news category. Then when you click on the post in the news category I still want it to stay. Then I would want a different ad to show up on a different single post in a different category. Now if you set up the conditional tag for is_single it only sets it up to show certain elements on all single posts. I woud like to show elements only on single posts, in a specific category.

    Any help would be appreciated soo much!

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

  3. ianbee
    Member
    Posted 1 year ago #

    if( is_single() && in_category('whatever') )

    http://codex.wordpress.org/Function_Reference/in_category

    http://codex.wordpress.org/Conditional_Tags

    DAYYYYYYYYYYYYYUUMMMMMMMM!!!!!! It worked! Thanks so much man! :) You just made my year! lollll

  4. arudd
    Member
    Posted 10 months ago #

    This helped me, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic