![]() |
How to exclude a category from the default WP Categories widget?
I never use widgets - I can't stand the things - but I HAVE to use widgets for this project.
Using the default Categories widget, how do I exclude certain categories from being listed in the sidebar? Update and Edit: Ok, that was fucking simple - in spite of the massive amount of incorrect information I received from Google and its three year old (yet extremely relevant - rofl) results... To exclude a category from the default sidebar widget, open default-widgets.php and add: Code:
$ex = 'whateverIDthecatis,anothercatID'; Code:
class WP_Widget_Categories extends WP_Widget Code:
$cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h, 'exclude' => $ex ); So, ignore this - unless I've missed something important - then I would truly appreciate your input. Posting this only because someone may search for this information... I doubt it - no-one searches for shit - but hey! |
Quote:
you want to hook into the filter widget_categories_args Code:
add_filter('widget_categories_args', 'my_cats_filter'); |
All times are GMT -7. The time now is 03:57 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123