• Resolved Robinero

    (@robinero)


    Hey there,

    I was wondering if it’s possible to query all taxonomies from a specific custom post type and display them with a description of the taxonomy.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • J M

    (@hiphopinenglish)

    This thread has something that I think is what you want.

    Thread.

    Thread Starter Robinero

    (@robinero)

    It’s getting closer, but that specific piece of code gets the posts out of CPT or Taxonomy. I want to get all the taxonomies out of CPT.

    Thread Starter Robinero

    (@robinero)

    With the following code I can get the taxonomies in a list, any idea how to attach a description of a taxonomy to that?

    ?php
    $taxonomy = 'subproject';
    $queried_term = get_query_var($taxonomy);
    $terms = get_terms($taxonomy, 'slug='.$queried_term);
    if ($terms) {
      echo '<ul>';
      foreach($terms as $term) {
      	echo '<li><a href="'.get_term_link($term->slug, $taxonomy).'">'.$term->name.'</a></li>';
      }
      echo '</ul>';
    }
    ?>
    J M

    (@hiphopinenglish)

    I think you need to call description inside your foreach part of the loop. It should be simple enough with Get Terms.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Taxonomies’ is closed to new replies.