azad_rpi

Show category name For custom post

May 14th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $taxonomy = 'nivo_cat'; //replace nivo_cat by your taxanomy name
  4. $terms = get_terms($taxonomy); // Get all terms of a taxonomy
  5.  
  6. if ( $terms && !is_wp_error( $terms ) ) :
  7. ?>
  8.     <ul>
  9.         <?php foreach ( $terms as $term ) { ?>
  10.             <?php echo $term->name; ?> <br />
  11.  
  12.     //to get category link
  13.     //<?php echo get_term_link($term->slug, $taxonomy); ?>
  14.  
  15.         <?php } ?>
  16.     </ul>
  17. <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment