Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !defined('ABSPATH') ) { die('-1'); } ?>
- <?php
- $args=array(
- 'tribe_events',
- 'showposts' => 5,
- 'eventDisplay' => 'custom',
- 'start_date' => $current_date,
- 'end_date' => $current_date
- );
- $my_query = null;
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <li>
- <?php if(has_post_thumbnail($post->ID, 'thumbnail')):
- $image_id = get_post_thumbnail_id($post->ID);
- $image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?>
- <a href="<?php echo get_permalink($post->ID) ?>" class="post-thumb"><img src="<?php echo $image_url[0]; ?>" alt="<?php echo $post->post_title ?>" /></a>
- <?php endif; ?>
- <div class="table-height">
- <h4 class="entry-title summary">
- <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h4>
- <div class="duration">
- <?php echo tribe_events_event_schedule_details(); ?>
- </div>
- <div>
- <a href="<?php echo tribe_get_event_website_link(); ?>" target="_blank" rel="bookmark">View Website</a>
- </div>
- <div>
- <?php the_excerpt() ?>
- </div>
- <div>
- <a href="<?php echo tribe_get_event_link() ?>" class="tribe-events-read-more" rel="bookmark"><?php _e( 'Find out more', 'tribe-events-calendar' ) ?> »</a>
- </div>
- </div>
- <?php if ( $cost && tribe_get_cost() != '' ) { ?>
- <span class="tribe-events-divider">|</span>
- <div class="tribe-events-event-cost">
- <?php echo tribe_get_cost( null, true ); ?>
- </div>
- <?php } ?>
- </li><?php
- endwhile;
- }
- wp_reset_query();?>
Advertisement
Add Comment
Please, Sign In to add comment