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

If I go to wp-admin/edit-tags.php?taxonomy=location then I correctly see a list of terms.

If I loop through:


Then I correctly see several terms for the taxonomy of category. Have I created my custom taxonomy incorrectly for the same function not to output any results for my taxonomy?


register_taxonomy('location', 'post', 
  'labels' => array( 'name' => _x( 'Locations',
    'taxonomy general name' ), 
    'singular_name' => _x( 'Location', 'taxonomy singular name' ), 
    'search_items' => __( 'Search Locations' ), 
    'all_items' => __( 'All Locations' ), 
    'parent_item' => __( 'Parent Location' ), 
    'parent_item_colon' => __( 'Parent Location:' ), 
    'edit_item' => __( 'Edit Location' ), 
    'update_item' => __( 'Update Location' ), 
    'add_new_item' => __( 'Add New Location' ), 
    'new_item_name' => __( 'New Location Name' ), 
    'menu_name' => __( 'Locations' ), 
  'rewrite' => array( 'slug' => 'locations',   
  'with_front' => false,   
  'hierarchical' => true   
share|improve this question
Sorry - the reply was in response to the answer above. Got posted in the wrong place. – user25516 Jan 3 '13 at 10:34
up vote 5 down vote accepted

If you are trying to use all of the terms in that taxonomy for something, try this:

get_terms( "location", array( "hide_empty" => 0 ) );

You may be trying to return taxonomy terms that have no relationship to any object.

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.