Guest User

Untitled

a guest
Sep 12th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. add_action('pre_get_posts','test_post_function_calendar');
  2. function test_post_function_calendar($query) {
  3.     if
  4.     ($query->is_main_query() &&
  5.     ( tribe_is_month() && !is_tax() ) ||
  6.     ( tribe_is_month() && is_tax() ) ||
  7.     ( tribe_is_event() && !tribe_is_day() && !is_single() ) ||
  8.     ( tribe_is_day() ) ||
  9.     ( tribe_is_venue() )
  10.     ) {
  11.  
  12.         $post_types = array();
  13.         $post_types[] = $query->query_vars['post_type'];
  14.         $post_types[] = 'post';
  15.         $query->set('post_type',$post_types);
  16.         //print_r($query->query_vars);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment