Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#16587 closed enhancement (duplicate)

wp_list_categories hide_empty counts unpublished posts

Reported by: grandslambert Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


The template tag wp_list_categories() has an option to hide_empty, however, this only hides categories that have no posts, no just no published posts. The result is that categories with only posts that are draft or pending show on the front end, and the links go to blank pages. It would be better if this argument for the tag would display only categories with published posts.

Change History (4)

#1 @greuben
5 years ago

Related/dupe #14084

#2 @garyc40
5 years ago

  • Keywords reporter-feedback added

I can't reproduce this when wp_list_categories() is using the default category taxonomy.

If you're using wp_list_categories() with a custom taxonomy, then this is a duplicate of #14084.

Otherwise, please paste the code snippet in which you're using wp_list_category().

#3 @grandslambert
5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

It is with a custom taxonomy and would be related to #14084 - but that also does not show any resolution. I will follow that ticket for now. Thank you.

#4 @ocean90
5 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.