WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

  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
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

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


if you use that inside loop, then you'd use get_posts() instead of get_categories();

$desired_category_ID = 239;
$desired_post_type = 'post';

$array =  get_posts('child_of'=>$desired_category_ID ,    'post_type'=> $desired_post_type);    $out='';
foreach ($array as $key=> $value) {
    $out .= '<li class="manual_posts"><a href="'.get_permalink($value->ID).'">'.$value->post_title.'</a></li>';
echo $out;
share|improve this answer

Your Answer


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.