I have a post about how to exclude the categories from WordPress default widget “Categories”. Now I’d like to bring to your attention how to modify the categories from WordPress default widget “Categories” for the users who probably doesn’t know WordPress coding so good. The solution is the following: add this code in the file functions.php of the using theme:

function modify_widget_categories($args){
  $include = "3,6,18"; // The IDs of the including categories
  $args["include"] = $include ;
  $args["hide_empty"] = 0; // If it is 0 it will show the empty categories as well
  return $args;

You can find the full list of parameters to modify the widget categories here: http://codex.wordpress.org/Function_Reference/get_categories#Default_Usage


Leave a Reply