Plugin Support
Lap
(@lapzor)
Hi Martin,
You can right click it, and choose “inspect” and you should see the ID of the widget, something like “widget-50_koko-analytics-most-viewed-posts-__i__”
Since it’s an ID you add # in front of it in CSS, so
#widget-50_koko-analytics-most-viewed-posts-__i__ { display: none; }
Hope that helps. If you have any questions, please let me know!
Thread Starter
Karis
(@askel45)
I am using PHP to hide the widgets, not CSS. This part koko-analytics-most-viewed-posts didn’t work. My code is like below. As you can see, the widget classes have underscores in default widgets and those added by other plugins. I would like to do the same for this plugin,
function unregister_default_widgets() {
unregister_widget('WP_Widget_Categories');
}
add_action('widgets_init', 'unregister_default_widgets');
-
This reply was modified 5 years, 12 months ago by
Karis.
Plugin Support
Lap
(@lapzor)
I think it should be this:
function unregister_default_widgets() {
unregister_widget(‘KokoAnalytics\Widget_Most_Viewed_Posts’);
}
add_action(‘widgets_init’, ‘unregister_default_widgets’);
For non default WordPress widgets you need to include the Namespace.
Let me know if that doesn’t work.
Plugin Support
Lap
(@lapzor)
Perfect, Thanks for letting me know.