Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to show a list of all categories available even if there are no posts associated with them. So if there is a post in that category then it echos a link and if not it just echos out the name of the category?

I'm using wp_list_categories() to show them...

share|improve this question

2 Answers 2

up vote 2 down vote accepted

There's an argument called hide_empty which is true by default.

$args = array('hide_empty' => FALSE);
wp_list_categories($args);

Codex: http://codex.wordpress.org/Template_Tags/wp_list_categories

share|improve this answer
    
Awesome, thanks –  benhowdle89 May 14 '11 at 13:41

Actually hide_empty needed a numerical value for me so

'hide_empty' =>0

worked for me

share|improve this answer
    
it makes no difference if hide_empty is set with false or 0 : see core.trac.wordpress.org/browser/tags/3.9.1/src/wp-includes/… –  Michal Mau Jun 9 at 10:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.