List the categories under custom taxonomy

The problem can only be one of the following:

  1. Your taxonomy “recipecategory” does not exist.

  2. Your taxonomy has no terms.

  3. None of your recipecategory terms have any posts. In this case, make the following change:

$tax_terms = get_terms($taxonomy, array('hide_empty' => false));

This should work as it will override the default setting, which is to ignore empty terms.

 foreach($tax_terms as $term_single) {      
         $term_single->slug;  
         $term_single->name;        
 } 

Leave a Comment