Created
August 2, 2012 02:30
-
-
Save MZAWeb/3232646 to your computer and use it in GitHub Desktop.
my_tribe_meta_event_cats (list without link)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_tribe_meta_event_cats() { | |
$tribe_ecp = TribeEvents::instance(); | |
$terms = get_the_terms( get_the_ID(), $tribe_ecp->get_event_taxonomy() ); | |
if ( $terms ) { | |
$term_names = wp_list_pluck( $terms, 'name' ); | |
$label = "Category"; | |
if ( count( $term_names ) > 1 ) { | |
$label = "Categories"; | |
} | |
echo sprintf( '<dt class="category-label">%s:</dt><dd class="category-meta">%s</dd>', $label, join( ", ", $term_names ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment