daily pastebin goal
14%
SHARE
TWEET

Add event category description to views

BakerMan Mar 24th, 2014 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top