If you use wordpress default widget in your theme, you will notice that you don't have an option to exclude the category. In such case you can use some plugin's and get your work done, but i prefer to use less plugins and do more of coding things. So in such case I write the below code in functions.php file located in my selected theme folder.
<?php
function exclude_widget_categories($args){
$exclude = "1,17"; // The IDs of the excluding categories
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","exclude_widget_categories");
?>
Comments
Post a Comment