I want to create a page that lists all the Custom Taxonomies, with each item linking to a page that will list all the terms in a given taxonomy.

I can produce a list of taxonomies using this

  'public'   => true,
  '_builtin' => false

$output = 'names'; // or objects
$operator = 'and'; // 'and' or 'or'
if  ($taxonomies) {
  foreach ($taxonomies  as $taxonomy ) {
    echo '<p>'. $taxonomy. '</p>' ;

But of course no links.

Looking at the codex there is very little information on the parameters - at least for neophyte like myself.

Any suggestions on how to output a link for each custom taxonomy?


  • 2
    Taxonomies don't have archive pages like that, so there's nothing really to link to in this case. Feb 24 '12 at 0:16

Once you get $taxonomy you can perform further logic:

$tax = get_taxonomy( $taxonomy );

if( isset( $tax->has_archive ) && $tax->has_archive == true ) {
    // do output. archive will be wordpress_url + $taxonomy->name
        <a href="<?php echo site_url( $taxonomy->name ); ?>">
            <?php echo $tax->labels->name; ?>

This is untested, but you get the idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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