Exclude Category from WordPress Category Widget

Glenn Blog 0 Comments

Here is a WordPress snippet to exclude a Category from displaying in the Native WordPress Category Widget. Simply add this tour your functions.php file in your theme:-


// Exclude Category from Native Wordpress Category Widget
function exclude_widget_categories($args){
$exclude = "1,2,4"; // The IDs 1,2,4 of the excluding categories
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","exclude_widget_categories");

About the Author
Exclude Category from WordPress Category Widget 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced WordPress Web Developer, Front-end and Back-end Developer & New Media Specialist with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries built up over a number of years.

Leave a Reply

Your email address will not be published. Required fields are marked *