Guest User

Untitled

a guest
Feb 20th, 2019
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <h2><?php the_terms( 0, 'my_category'); ?></h2>
  2.  
  3. $my_categories = get_the_terms( null, 'my_category' );
  4.  
  5. foreach ( $my_categories as $my_category ) {
  6. echo $my_category->name;
  7. }
  8.  
  9. $my_categories = get_the_terms( null, 'my_category' );
  10. $category_names = wp_list_pluck( $my_categories, 'name' );
  11.  
  12. echo implode( ', ', $category_names );
RAW Paste Data