WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] Trying to limit widgets on single post pages for only some categories (7 posts)

  1. kunnagh
    Member
    Posted 1 year ago #

    I've tried various combinations of is_single, is_category and in_category, but I can't make this happen.

    We have three categories defined, and for one of them we'd like to limit what widgets appear in the sidebar, when we're looking at the page that displays the whole of the categorised post. The problem seems to be linked to the single post page not 'inheriting' the category that the single post it is displaying has set.

    Is this possible within the widget-logic plugin, and if so, what blindingly obvious thing am I missing?

    Many thanks

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    all you need should be

    is_single() && in_category(X)

    so if that's not working soemthing else is going on.

  3. kunnagh
    Member
    Posted 1 year ago #

    Hi

    Thanks for that. No, that doesn't do it, but I think this is more theme related than plugin so I need to investigate that. Thanks for the confirmation that I'm not trying to do something impossible, though.

  4. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    try switching to a wordpress standard theme to see if the theme code is interfering. you could also try the wp_reset_query option

  5. kunnagh
    Member
    Posted 1 year ago #

    Hi Alan

    Another plugin was interfering with the result of in_category, which was throwing the result off. Sorted now, thanks very much for your assistance.

    Cheers

    Kunnagh

  6. stevecummins
    Member
    Posted 1 year ago #

    Hi,
    I'm having what I believe is a similar problem.
    I have an ad that I want to display in all posts within the entertainment category but cant seem to figure out how to do this

  7. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    is that not the same problem as before? ie is_single() && in_category(X)

    (sorry it's late, I'm probably missing some subtle difference)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic