Advertisement
BakerMan

Add event category description to views

Mar 24th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. add_action( 'tribe_events_after_header', 'add_event_category_description' );
  2.  
  3. function add_event_category_description() {
  4.     // Does this request relate to an event category? Which one?
  5.     $category = $GLOBALS['wp_query']->get( 'tribe_events_cat' );
  6.     if ( empty( $category ) ) return;
  7.  
  8.     // Load the category object
  9.     $category = get_term_by( 'slug', $category, TribeEvents::TAXONOMY );
  10.     if ( false == $category ) return;
  11.  
  12.     echo apply_filters( 'the_content', $category->description );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement