View Single Post
Old 10-09-2011, 12:31 PM  
garce
Confirmed User
 
garce's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: Toronto
Posts: 7,103
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';
under

Code:
class WP_Widget_Categories extends WP_Widget
The source told me what to do right here:

Code:
$cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h, 'exclude' => $ex );
I should have just opened default-widgets.php and read the source before searching useless Google.

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!
garce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote