get_categories includes categories with drafts
-
On a client site I am using get_categories to list the categories and also display the number of posts inside each category.
For some reason it’s also displaying categories that have no published posts inside them, but are not empty. Which means: categories with only drafts in them are also getting displayed.
Ofcourse this shouldn’t happen, because those posts are drafts for a reason and visitors get a ‘No posts found’ message when they click on the categories with only drafts inside them.
I couldn’t find anything about this in the doc’s, nor in the forums. Is there a way to exclude those categories from being listed?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘get_categories includes categories with drafts’ is closed to new replies.