[Wordpress] Get TERMS List


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function getTheTerms($tax) {
  2. $args = array( 'taxonomy' => $tax, 'hide_empty' => 1 );
  3. $terms = get_terms($tax, $args);
  4. foreach ($terms as $term) { ?>
  5. <li><a href="<?php echo get_bloginfo('wpurl'); ?>/taxonomyrewrite/<?php echo $term->slug; ?>/" title="<?php echo $term->name; ?>"><?php echo $term->name; ?></a></li>
  6. <?php }
  7. }//getTheTerms

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.