7,000+
February 13, 2025
March 28, 2011
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.
Standard Installation Procedure
cets-conditional-widgets folder to the /wp-content/plugins/ directoryYes 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;
}
If you really want to be able to use Conditional Widgets to control Widget display on individual instances of a Custom Post Type (rather than based on a Taxonomy), the workaround would be to create unique Taxonomy terms for those Custom Posts.
Updated tested to version, documented support for custom post type and taxonomy support