Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // We only want to run this for single instances
- if (is_single()) {
- // Load the categories associated with this event
- $terms = get_the_terms(get_the_ID(), TribeEvents::TAXONOMY);
- // If any were returned, display the name of the *first* category
- if (count($terms) > 0) {
- $category = array_shift($terms);
- echo $category->name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement