Hide a category in the sidebar
-
I read on
https://codex.www.ads-software.com/Template_Tags/wp_list_cats
that the function callwp_list_cats()
can be used to hide specified categories.Yet, when I use the following call, only the second category is hidden, leaving the first (the ‘Uncategorized’ category) still showing on the side bar.
wp_list_cats('sort_column=name&exclude="1, 2"');
Now, when I don’t enclose the category IDs using double quotes (see example below), I get an error saying that the function call
foreach()
intemplate-functions-category.php
received an invalid argument.wp_list_cats('sort_column=name&exclude=1, 2');
Any reason why?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Hide a category in the sidebar’ is closed to new replies.