Restrict Widgets
[resolved] Hide widget in category AND single pages for that category (3 posts)

  1. kstarcher
    Posted 2 years ago #

    Hi there.
    I need to hide a certain widget in 3 out of the 4 categories of a site. In the category where it is displayed, it should appear in both the category archive page AND the single page within that category only.

    However, the options I see only give me the option for all single pages or none, so I can't see a way to manage "every way of displaying a post in this category".

    Any brilliant ideas?



  2. dFactory
    Plugin Author

    Posted 2 years ago #

    Yes, there is a brilliant filter :) that allows you to set up any display condition you need. It's described in the documentation here: http://www.dfactory.eu/docs/restrict-widgets-plugin/filters/rw_display_widget/. You can use any conditional tags available in WordPress: http://codex.wordpress.org/Conditional_Tags

    In this case you should focus on "in_category()" template tag especially (it checks if the current post is in the specified category id.).

  3. kstarcher
    Posted 2 years ago #

    That's done 'er! Thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Restrict Widgets
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.