Conditional Widgets
IMPORTANT: This plugin will NOT function after the Widgets screen overhaul that is part of WordPress 5.8 unless you use the Classic Widgets plugin (https://wordpress.org/plugins/classic-widgets/). The plugin will continue to be supported/maintained for those using Classic Widgets, but there are no p
IMPORTANT: This plugin will NOT function after the Widgets screen overhaul that is part of WordPress 5.8 unless you use the Classic Widgets plugin (https://wordpress.org/plugins/classic-widgets/). The plugin will continue to be supported/maintained for those using Classic Widgets, but there are no plans to make Conditional Widgets work once Widgets are Blocks.
This plugin adds a form to each widget on the Widgets panel which allows users to choose which pages and/or categories the widget is either displayed on or hidden from.
For each widget, you can choose criteria to either SHOW or HIDE the widget, based on a number of categories. The interface is quite intuitive, and requires no knowledge of php or conditional tags.
A closer look.
Standard Installation Procedure
- 01Upload the cets-conditional-widgets folder to the /wp-content/plugins/ directory
- 02Activate the plugin through the ‘Plugins’ menu in WordPress
Frequently asked questions.
Can I Use it with Custom Post Types or Taxonomies?
Yes and No.
Conditional Widgets can be configured with additional Type/Taxonomy pairs (both native and custom), similar to how it functions with Posts and Categories. However, it does not support additional Custom Post Types the way it does Pages. (If I were going to write it from scratch, I would have definitely included that, but have no plans to add it given that Widgets themselves are on the way to becoming unsupported.)
The following filter is available to take pairs of Post Type and Taxononmy slugs (use in functions.php or a small plugin):
// Add Conditional Widgets support for Success Stories (Post Type) & Story Groups (Taxonomy) add_filter('conditional_widgets_type_tax_pairs', 'success_story_conditional_widget_type_tax_pairs' ); function success_story_conditional_widget_type_tax_pairs( $pairs_array ) { $success_story_pair = array( 'type'=> 'success-story', 'tax'=> 'story-group' ); $pairs_array[] = $success_story_pair; return $pairs_array; }