Guest User

steve-mgi

a guest
Nov 24th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <!--  CALENDAR START -->
  2. <?php
  3. $args = array(
  4. 'post_type' => array(TribeEvents::POSTTYPE),
  5. 'posts_per_page' => 10,
  6. 'post_status' => 'publish',
  7. 'meta_query' => array(
  8. 'relation' => 'OR',
  9. array(
  10. 'key' => '_EventStartDate',
  11. 'value' => array(
  12. date('Y-m-d H:i:s', strtotime('now')),
  13. date('Y-m-d H:i:s', strtotime('+16 weeks'))),
  14. 'compare' => 'BETWEEN',
  15. 'type' => 'DATETIME'
  16. ),
  17. array(
  18. 'key' => '_EventEndDate',
  19. 'value' => array(
  20. date('Y-m-d H:i:s', strtotime('now')),
  21. date('Y-m-d H:i:s', strtotime('+16 weeks'))),
  22. 'compare' => 'BETWEEN',
  23. 'type' => 'DATETIME'
  24. )
  25. ),
  26. 'tax_query' => array(
  27. array(
  28. 'taxonomy' => TribeEvents::TAXONOMY,
  29. 'field' => 'slug',
  30. 'terms' => array('management-development'),
  31. 'operator' => 'IN'
  32. )
  33. )
  34. );
  35. $get_posts = null;
  36. $get_posts = new WP_Query();
  37. $get_posts->query($args);
  38. if($get_posts->have_posts()) : while($get_posts->have_posts()) : $get_posts->the_post(); ?>
  39.  
  40. <div class="entry">
  41.   <!--<div class="mgi-event-title"><a href="<php the_permalink(); ?>"><php the_title(); ?></a></div> -->
  42.   <div class="mgi-event-list">
  43.     <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
  44.     <?php echo tribe_get_start_date(); ?> - <?php echo tribe_get_end_date(); ?></div>
  45.   <?php } else { ?>
  46.   <?php echo tribe_get_start_date(); ?> <a href="<?php the_permalink(); ?>">&nbsp;&nbsp;> View Details</a></div>
  47. <?php } ?>
  48. </div>
  49. <?php
  50. endwhile;
  51. endif;
  52. wp_reset_query();
  53. ?>
  54. <!--  CALENDAR END -->
Advertisement
Add Comment
Please, Sign In to add comment