Sep 2, 2012

Exclude category from wordpress default widget

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.

function exclude_widget_categories($args){
$exclude = "1,17"; // The IDs of the excluding categories
$args["exclude"] = $exclude;
return $args;

No comments:

Post a Comment