Widget Logic and WordPress 5.8.1

Posted on Sep 27, 2021 in Content, Main

We have used Widget Logic (plugin) to display WordPress widgets on page(s) and or categories of our choosing using the WordPress conditional tags. For example would create side widget to a page using code like is_page (‘100’) to add a particular sidebar widget on the page with the ID of 100.

WordPress 5.8.1 switches the look of widgets from what is now called the classic widget look to the widget block editor; similar to the post and page block editor. Most of our WordPress sites have classic editor as the default choice. The block widget editor does not display any conditionals created with Widget Logic.

We have found a plugin called Widget Options that will allow the use of conditionals with your widgets and use the classic widget interface.

widget options default settings

The default setting for Widget Options is to “hide on checked pages” which turns the widget on everywhere.. You will need to change the setting to “show on checked pages” if you want a widget to display on a particular page; “Misc” is the default tab where you can choose what pages you would like the widget to be displayed. You may also select where a widgets displays by selecting “Post Types” and/or “Taxonomies” (categories).
widget options gear icon settings
Select the gear setting if you would like to use conditionals to display your widgets. In our example on the left, the widget is only being shown on the post with the ID of 2208.