Advertisement
BakerMan

Nini: minical tweak

Sep 3rd, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. <?php
  2.  
  3. global $post, $wp_query;
  4.  
  5. $class = "";
  6. if ( $wp_query->current_post == 1 ) {
  7.     $class = ' first ';
  8. }
  9. if ( $wp_query->current_post+1 == $wp_query->post_count ) {
  10.     $class .= ' last ';
  11. }
  12.  
  13. $startDate = strtotime( $post->EventStartDate );
  14. $endDate   = strtotime( $post->EventEndDate );
  15. $today     = time();
  16.  
  17. /* If the event starts way in the past or ends way in the future, let's show today's date */
  18. if ( $today > $startDate && $today < $endDate )
  19.     $postDate = $today; else
  20.     $postDate = $startDate;
  21.  
  22. /* If the user clicked in a particular day, let's show that day as the event date, even if the event spans a few days */
  23. if ( defined( "DOING_AJAX" ) && DOING_AJAX && isset( $_POST['action'] ) && $_POST['action'] == 'tribe-mini-cal-day' )
  24.     $postDate = strtotime( $_POST["eventDate"] );
  25.  
  26. ?>
  27.  
  28. <div class="tribe-mini-calendar-event event-<?php echo $wp_query->current_post;?><?php echo $class;?>">
  29.     <div class="list-date">
  30.         <span
  31.             class="list-dayname"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date( 'D', $postDate ), $postDate, $class ); ?></span>
  32.         <span
  33.             class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', date( 'd', $postDate ), $postDate, $class ); ?></span>
  34.     </div>
  35.     <div class="list-info">
  36.         <h2><a href="<?php echo tribe_get_event_link(); ?>"><?php echo $post->post_title; ?></a></h2>
  37.         <?php if ( tribe_get_cost() ) { ?>
  38.             <span class="tribe-mini-calendar-event-cost"><?php echo tribe_get_cost( null, true ); ?></span>
  39.             <div class="tribe-events-divider ">|</div>
  40.         <?php } ?>
  41.         <?php echo tribe_events_event_schedule_details(); ?>
  42.         <?php if ( tribe_get_venue() ) { ?>
  43.             <div class="tribe-mini-calendar-event-venue">
  44.                 <?php echo tribe_get_venue_link( $post->ID ); ?>
  45.             </div>
  46.         <?php } ?>
  47.         <!-- Event Image -->
  48.         <?php echo tribe_event_featured_image( null, 'small' ) ?>
  49.  
  50.         <!-- Event Content -->
  51.         <div class="tribe-events-list-event-description tribe-events-content description entry-summary">
  52.             <?php echo apply_filters( 'get_the_excerpt', $post->post_excerpt ) ?>
  53.             <a href="<?php echo tribe_get_unslashed_event_link() ?>" class="tribe-events-read-more" rel="bookmark"><?php _e( 'Buy Tickets', 'tribe-events-calendar' ) ?> &raquo;</a>
  54.         </div><!-- .tribe-events-list-event-description -->
  55.     </div>
  56. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement