Guest User

Untitled

a guest
Nov 18th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. //Modern Tribe ECP Filter
  2. function tribe_filtered_cat_display() {
  3. global $post;
  4. //Setup Variables
  5. $slug = get_post( $post )->post_name; // I'll need the current page's slug in my query
  6. $cat_events = new WP_Query();
  7. $cat_events->query(array(
  8. 'post_type'=> 'tribe_events',
  9. 'eventDisplay'=>'upcoming',
  10. 'posts_per_page'=>3,
  11. 'tax_query'=> array(
  12. array(
  13. 'taxonomy' => 'tribe_events_cat',
  14. 'field' => 'slug',
  15. 'terms' => $slug
  16. )
  17. )
  18. )
  19.  
  20. );
  21.  
  22. if ($cat_events->have_posts()) :
  23. while ($cat_events->have_posts()) :
  24. $cat_events->the_post();
  25. $sttime = tribe_get_start_date($post, false, $format= 'h:i A');
  26. $endtime = tribe_get_end_date($post, false, $format= 'h:i A');
  27. ?>
  28. <div class="date">
  29. <?php echo tribe_get_start_date($post, false, $format = 'M' ); ?>
  30. <?php echo tribe_get_start_date($post, false, $format = 'd' ); ?>
  31. </div>
  32. <div class="details">
  33. <h6 class="title"><a href="<?php echo tribe_get_event_link() ?>" rel="bookmark"><?php the_title(); ?></a></h6>
  34. <?php if ( $cost && tribe_get_cost() ) { ?>
  35. <span class="cost"><?php echo tribe_get_cost( null, true ); ?></span>
  36. <div class="divider ">|</div>
  37. <?php } ?>
  38. <?php if(tribe_event_is_all_day() == false) {echo $sttime . ' &ndash; ' . $endtime . '<br />';} else {echo $sttime . '<br />';}; ?>
  39. <span class="venue"><?php echo tribe_get_venue_link(); ?></span>
  40. </div><hr />
  41. <?php endwhile;
  42. else :
  43. echo 'There are no events to display.';
  44. endif;
  45. wp_reset_query(); // Don't forget to reset the query.
  46. }
Advertisement
Add Comment
Please, Sign In to add comment