Skip to content

Instantly share code, notes, and snippets.

@asha23
Created March 4, 2016 11:37
Show Gist options
  • Save asha23/c2e0022b204b5f6ac7e9 to your computer and use it in GitHub Desktop.
Save asha23/c2e0022b204b5f6ac7e9 to your computer and use it in GitHub Desktop.
Get the taxonomy and use it as a title (single taxonomies only)
<?php
global $post;
$trm = get_post_type($post);
$taxonomies = get_object_taxonomies($trm);
$terms = wp_get_object_terms( $post->ID, $taxonomies[0] );
foreach( $terms as $term ):
$term_names[] = $term->name;
$stageName = implode($term_names); // you'll need to add an argument here if artists appear on more than one stage
endforeach;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment