i need some help how can i display custom taxonomies on selected pages? i mean i have 3 custom taxonomies location,duration & courses i have created three pages where i want to display the terms of these custom taxonomies, i have displayed it on my posts by using function

<?php echo do_shortcode("[terms]"); ?>

but same thing i want to make display on my pages also, how can i do that??????

1 Answer 1


If you want to display a list of all terms in a taxonomy, you can call wp_list_categories() and pass the taxonomy argument to get anything other than the categories:

wp_list_categories( array(
    'taxonomy' => 'your-taxonomy'
) );

If you want to use a shortcode for this, so you can use it in your post content, use add_shortcode(). This untested example code allows you to use [taxonomy_terms] or [taxonomy_terms taxonomy=my-taxonomy] in your content:

add_shortcode( 'taxonomy_terms', 'wpse4668_taxonomies' );
function wpse4668_taxonomies( $atts )
    // Sanitize our input
    $atts = shortcode_atts( array(
        'taxonomy' => 'your-default-taxonomy',
    ), $atts );
    // Don't echo the output, just return it
    $atts['echo'] = 0;

    return wp_list_categories( $atts );
  • thanks u helped me but i have one more question, i used the method wp_list_categories, but in the heading it is showing Categories where as it is my custom taxonomies, i want that to be printed how can i do that? Commented Nov 30, 2010 at 14:25
  • @ntechi: In the linked codex page you can see that wp_list_categories() accepts a title_li parameter that you can set. You can even expand the shortcode handler to automatically get this from the definition of the taxonomy.
    – Jan Fabry
    Commented Nov 30, 2010 at 15:06
  • it is done can you help me in a plugin wordpress.stackexchange.com/questions/4723/need-plugin-help this is the question Commented Dec 1, 2010 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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