Created
June 30, 2016 23:00
-
-
Save jasonyost/28b53d115a1a487a53ac05d54490b8a8 to your computer and use it in GitHub Desktop.
Exclude categories from categories widget in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to functions.php in the theme to exclude categories from the built-in categories widget | |
function exclude_widget_categories($args){ | |
$exclude = "105,102,108,112"; // The IDs of the excluding categories | |
$args["exclude"] = $exclude; | |
return $args; | |
} | |
add_filter("widget_categories_args","exclude_widget_categories"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment