Guest User

list-widget.php

a guest
Jul 23rd, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.81 KB | None | 0 0
  1. <?php
  2. if ( !defined('ABSPATH') ) { die('-1'); } ?>
  3.  <?php
  4.   $args=array(
  5. 'tribe_events',
  6. 'showposts' => 5,
  7. 'eventDisplay' => 'custom',
  8. 'start_date' => $current_date,
  9. 'end_date' => $current_date
  10. );
  11.  $my_query = null;
  12.  $my_query = new WP_Query($args);
  13.  if( $my_query->have_posts() ) {
  14.  while ($my_query->have_posts()) : $my_query->the_post(); ?>
  15.  
  16. <li>
  17. <?php if(has_post_thumbnail($post->ID, 'thumbnail')):
  18. $image_id = get_post_thumbnail_id($post->ID);
  19. $image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?>
  20. <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>
  21. <?php endif; ?>
  22.         <div class="table-height">
  23.         <h4 class="entry-title summary">
  24.  
  25. <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
  26.         </h4>
  27.         <div class="duration">
  28.                         <?php echo tribe_events_event_schedule_details(); ?>  
  29.         </div>
  30.         <div>
  31.                         <a href="<?php echo tribe_get_event_website_link(); ?>" target="_blank" rel="bookmark">View Website</a>
  32.         </div>
  33.         <div>
  34.                         <?php the_excerpt() ?>
  35.         </div>
  36.         <div>
  37.         <a href="<?php echo tribe_get_event_link() ?>" class="tribe-events-read-more" rel="bookmark"><?php _e( 'Find out more', 'tribe-events-calendar' ) ?> &raquo;</a>
  38.         </div>
  39.         </div>
  40.         <?php if ( $cost && tribe_get_cost() != '' ) { ?>
  41.                 <span class="tribe-events-divider">|</span>
  42.                 <div class="tribe-events-event-cost">
  43.                         <?php echo tribe_get_cost( null, true ); ?>
  44.                 </div>
  45.         <?php } ?>                    
  46. </li><?php
  47.       endwhile;
  48.     }
  49.     wp_reset_query();?>
Advertisement
Add Comment
Please, Sign In to add comment