Advertisement
qlstudio

wp TEC get current category

Sep 26th, 2012
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. // get event category function - for The Events Calander plugin ##
  2. function ql_get_events_cat() {
  3.  
  4.     $current_category = get_the_terms( get_the_ID(), "tribe_events_cat" );
  5.  
  6.     if ( !empty( $current_category ) ) {
  7.         foreach ( $current_category as $term ) {
  8.             $cats[] = $term->name;
  9.         }
  10.     }
  11.  
  12.     // take first ##
  13.     return $cats[0];
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement