Support » Themes and Templates » How to hide widgets by a specific title
4 years, 6 months ago
I cannot find this on Google anywhere, but I have a situation where I only want a widget with title “Contact Me” to display in my sidebar. I want to hide widgets with any other title.
I tried <?php the_widget(‘WP_Widget_Text’, “title=Contact Me”); ?> , but it did not display.
Any help would be appreciated.
You can remove the widgets from your sidebar by going to your dashboard and then:
Appearance >> Widgets
It looks like this:
You can now delete the individual widgets.
thanks, playing2012m, but I this is for a multisite and I need to do this programmatically to prevent the other administrators fro showing the widgets even if they add them from the widget menu.