azad_rpi

Show category name For custom post

May 14th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  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. <?php } ?>
  12. </ul>
  13. <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment