Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h2><?php the_terms( 0, 'my_category'); ?></h2>
- $my_categories = get_the_terms( null, 'my_category' );
- foreach ( $my_categories as $my_category ) {
- echo $my_category->name;
- }
- $my_categories = get_the_terms( null, 'my_category' );
- $category_names = wp_list_pluck( $my_categories, 'name' );
- echo implode( ', ', $category_names );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement