Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. $terms = get_the_terms($post->ID,'type');
  3. foreach ( $terms as $term ) :
  4. $typeName = array();
  5. $typeName[] = $term->name;
  6. ?>
  7. <small><?php echo implode(', ', $typeName); ?></small>
  8. <?php endforeach; ?>
  9.  
  10. $terms = get_the_terms($post->ID,'category');
  11. $typeName = array();
  12. foreach ( $terms as $term ) {
  13. $typeName[] = $term->name;
  14. } ?>
  15. <small><?php echo implode(', ', $typeName); ?></small><?php
  16.  
  17. $terms = get_the_terms($post->ID,'category');
  18. $typeName = wp_list_pluck($terms,'name'); ?>
  19. <small><?php echo implode(', ',$typeName) ;?></small><?php
  20.  
  21. $terms = get_the_term_list( $post->ID, 'category', $before = '', $sep = ', ', $after = '' ); ?>
  22. <small><?php echo $terms; ?></small><?php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement