View difference between Paste ID: fgpC2ND1 and uTkuk3N5
SHOW: | | - or go back to the newest paste.
1
<?php
2
$startDate = date(  "Y-m-d", strtotime( $startDate ) );
3
$endDate = date(  "Y-m-d", strtotime( $endDate ) );
4
5
global $post;
6
7
 $featured_query = new WP_Query();
8-
	$featured_query->query(
8+
 $featured_query->query(
9
   array(
10-
		  'post_type' => 'tribe_events',
10+
    'post_type' => 'tribe_events',
11
    'posts_per_page' => -1,
12
    'orderby' => 'meta_value',
13
    'order' => 'ASC',
14
    'meta_key' => '_EventStartDate',
15
    'meta_query' => array(
16
       array(
17
        'key' => '_EventStartDate',
18
        'value' => array( $startDate.' 00:00:00', $endDate.' 23:59:59'),
19
        'type' => 'DATETIME',
20
        'compare' => 'BETWEEN'
21
      )
22
    )
23-
	  )
23+
   )
24
  );
25
26-
	if ($featured_query->have_posts()) :
26+
 if ($featured_query->have_posts()) :
27-
		while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
27+
  while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
28
  <?php global $more; $more = false; ?>
29
30-
  // DO WHATEVER YOU NEED TO DO WITH THE POSTS HERE
30+
  
31
     //DO WHATEVER YOU NEED TO DO WITH THE POSTS HERE
32-
		<?php endwhile; ?>
32+
33-
	 <?php else: echo  '<h4> Sorry, there are no posts for the selected dates.</h4>'; ?>
33+
34
  <?php endwhile; ?>
35
  <?php else: echo  '<h4> Sorry, there are no posts for the selected dates.</h4>'; ?>
36-
	<?php wp_reset_query();?>
36+
37
 <?php endif; ?>
38
 <?php wp_reset_query();?>