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.

I've many categories in my database but when i'm calling wp_list_categories() it is not listing any categories, its only outputting

Categories
  No categories

Also, I'm trying to populate it using get_categories() but still same problem, it outputting as if there were no category

share|improve this question
1  
Are these categories listed in the backend? Check if all of them have posts associated as these functions hide empty categories by default. –  Rutwick Gangurde Apr 25 '12 at 5:02
    
no, none of them have posted associated with them. Still, what functions can i use to access all the categories?? –  Noor Apr 25 '12 at 5:17
    
Check my answer below... –  Rutwick Gangurde Apr 25 '12 at 5:35
add comment

1 Answer

You can use wp_list_categories or get_categories, just pass hide_empty = 0 to it. This will get you even those categories which do not have any posts associated with them.

Ex: $cats = get_categories(array('hide_empty' => 0));

share|improve this answer
add comment

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.