Created
February 27, 2021 16:26
Exclude Category from WordPress Category Widget
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
// 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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment