Guest User

Events Calendar Victoria

a guest
May 13th, 2015
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1.     <?php
  2.  
  3.     $citywideEvents = wp_get_post_terms( $post->ID, 'citywide' );
  4.  
  5.     $cityevents = new WP_Query(
  6.         array(
  7.             'posts_per_page' => 4,
  8.             'post_type' => 'events',
  9.             'events_type' => $eventsTerms,
  10.             'category' => array( $post->ID )  
  11.             )
  12.     ); ?>
  13.  
  14.     <?php if ( $cityevents->have_posts() ) : ?>
  15.  
  16.         <?php while ($cityevents->have_posts()) : $cityevents->the_post(); ?>
  17.  
  18.             <?php
  19.                 $events = tribe_get_events( array(
  20.                 'posts_per_page' => 5,
  21.                 'start_date' => new DateTime()
  22.                 ) );
  23.  
  24.                 foreach ( $cityevents as $post ) {
  25.                     setup_postdata( $post );
  26.                  
  27.                     // This time, let's throw in an event-specific
  28.                     // template tag to show the date after the title!
  29.                     the_title();
  30.                     echo tribe_get_start_date();
  31.                     the_content();
  32.                 }
  33.             ?>
  34.  
  35.         <?php endwhile; ?>
  36.        
  37.         <?php wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment