Elmsworth

ECP Today's Events

Jul 9th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1.     <?php
  2.     global $post;
  3.     $CurrentDate = date('Y-m-d');
  4.     $events_today = tribe_get_events(
  5.         array(
  6.             'start_date'=>$CurrentDate,
  7.             'end_date'=>$CurrentDate,
  8.             'tax_query'=> array(
  9.                 array(
  10.                     'taxonomy' => 'tribe_events_cat',
  11.                     'field' => 'id',
  12.                     'terms' => '102',
  13.                     'operator' => 'NOT IN'
  14.                     )
  15.                 )
  16.             )
  17.     );
  18.        
  19.         foreach($events_today as $post) {
  20.         setup_postdata($post);
  21.         ?>
  22.        
  23.         <?php if ( has_post_thumbnail() ) { ?>
  24.        
  25.             <div class="thumbList">
  26.                 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail('thumbnail', array('class' => 'scale-with-grid attachment-thumbnail')); ?></a>
  27.             </div>
  28.            
  29.             <div class="event-excerpt">
  30.                 <h6 class="event-title"><span class="front-start-time"><?php echo tribe_get_start_date( $post->ID, false, 'g:i a' ); ?> </span><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6>
  31.                 <?php the_excerpt(); ?>
  32.             </div>
  33.            
  34.             <div class="clear"></div>
  35.        
  36.         <?php } else { ?>
  37.        
  38.             <div class="event-content">
  39.                 <?php the_excerpt(); ?>
  40.             </div>
  41.            
  42.             <div class="clear"></div>
  43.        
  44.         <?php } ?>
  45.    
  46.            
  47.     <?php } //endforeach ?>
  48.     <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment