Support » Plugin: Widget Logic » exclude from category -both category landing and single posts

  • Resolved streettb

    (@streettb)


    I need some help with the correct logic…I’m trying to have a widget appear across my blog EXCEPT for in a category (the widget should NOT appear in both the category landing page and single posts of that category).

    This logic is not working:

    !( is_single() && in_category (‘how-to-not-look-like-a-freshman’)) || !is_category (‘how-to-not-look-like-a-freshman’)

    The widget is not appearing on the category landing page (which I want), but is showing on the single posts in the category…

    how do I properly form !( is_single() && in_category (‘how-to-not-look-like-a-freshman’)) so that the widget won’t appear in the single posts of the category?

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

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

    (@alanft)

    the opposite of that, to make it appear on a category page or single posts is in the FAQ as

    is_category(X) || (is_single() && in_category(X))

    so reverse that with !( … ) around it like this…

    !( is_category(X) || (is_single() && in_category(X)) )

    Yes, that logic works – many thanks for your quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘exclude from category -both category landing and single posts’ is closed to new replies.