Support » Plugin: Widget Logic » Trying to limit widgets on single post pages for only some categories

  • Resolved kunnagh


    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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor alanft


    all you need should be

    is_single() && in_category(X)

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


    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.

    Plugin Contributor alanft


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

    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.



    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

    Plugin Contributor alanft


    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)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trying to limit widgets on single post pages for only some categories’ is closed to new replies.