BakerMan

Conditional Template Tag for TEC (is_events_page)

Sep 2nd, 2012
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. function is_events_page() {
  2.         global $wp;
  3.         $query = wp_parse_args($wp->matched_query);
  4.  
  5.         if (array_key_exists('tribe_events', $query) or
  6.                 array_key_exists('tribe_venue', $query))
  7.                         return true;
  8.  
  9.         if (array_key_exists('post_type', $query) and
  10.                 $query['post_type'] === 'tribe_events')
  11.                         return true;
  12.  
  13.         return false;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment