jonahcoyote

Custom Event Taxonomy Query

Jan 27th, 2012
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2. global $post;
  3.                                     $event_cats = wp_get_object_terms($post->ID, 'tribe_events_cat');
  4.                                     if(!empty($event_cats)){
  5.                                         echo '<dt>Category: </dt>';
  6.                                         foreach($event_cats as $cat){
  7.                                             if($cat->term_id == 9) {
  8.                                                 echo '<dd><a href="/calendar/upcoming/category'.$cat->slug.'/">'.$cat->name.' test</a></dd>';
  9.                                             } else {
  10.                                                 echo '<dd><a href="'.get_term_link($cat->slug, 'tribe_events_cat').'">'.$cat->name.'</a></dd>';
  11.                                             }
  12.                                         }
  13.                                     }
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment