Guest User

list-widget.php

a guest
Jul 17th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.78 KB | None | 0 0
  1. <?php
  2. if ( !defined('ABSPATH') ) { die('-1'); } ?>
  3.  
  4. <li>
  5. <?php if(has_post_thumbnail($post->ID, 'thumbnail')):
  6. $image_id = get_post_thumbnail_id($post->ID);
  7. $image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?>
  8. <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>
  9. <?php endif; ?>
  10.     <div class="table-height">
  11.     <h4 class="entry-title summary">
  12. <?php $my_query = new WP_Query(‘tribe_events’,
  13. ‘showposts’ => 5,
  14. ‘eventDisplay’ => 'custom',
  15. ‘start_date’    => $current_date,
  16. ‘end_date’   => $current_date);
  17.  if ($my_query->have_posts()) :
  18.  while ($my_query->have_posts()) : $my_query->the_post(); ?>
  19. <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
  20.     </h4>
  21.     <div class="duration">
  22.             <?php echo tribe_events_event_schedule_details(); ?>   
  23.     </div>
  24.     <div>
  25.             <a href="<?php echo tribe_get_event_website_link(); ?>" target="_blank" rel="bookmark">View Website</a>
  26.     </div>
  27.     <div>
  28.             <?php the_excerpt() ?>
  29.     </div>
  30.     <div>
  31.     <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>
  32.     </div>
  33.     </div>
  34.     <?php if ( $cost && tribe_get_cost() != '' ) { ?>
  35.         <span class="tribe-events-divider">|</span>
  36.         <div class="tribe-events-event-cost">
  37.             <?php echo tribe_get_cost( null, true ); ?>
  38.         </div>
  39.     <?php } ?>         
  40.     <div class="vcard adr location">   
  41.  
  42.         <?php if ( $venue  && tribe_get_venue() != '') { ?>
  43.             <span class="fn org tribe-venue"><?php echo tribe_get_venue_link(); ?></span>
  44.         <?php } ?>
  45.  
  46.         <?php if ( $address && tribe_get_address() != '' ) { ?>
  47.             <span class="street-address"><?php echo tribe_get_address(); ?></span>
  48.         <?php } ?>
  49.  
  50.         <?php if ( $city && tribe_get_city() != '' ) { ?>
  51.             <span class="locality"><?php echo tribe_get_city(); ?></span>
  52.         <?php } ?>
  53.  
  54.         <?php if ( $region && tribe_get_region() !='' ) { ?>
  55.             <span class="region"><?php echo tribe_get_region(); ?></span>
  56.         <?php   } ?>
  57.  
  58.         <?php if ( $zip && tribe_get_zip() != '' ) { ?>
  59.             <span class="postal-code"><?php echo tribe_get_zip(); ?></span>
  60.         <?php } ?>
  61.  
  62.         <?php if ( $country  && tribe_get_country() != '') { ?>
  63.             <span class="country-name"><?php echo tribe_get_country(); ?></span>
  64.         <?php } ?>
  65.  
  66.         <?php if ( $organizer && tribe_get_organizer() != '' ) { ?>
  67.         <?php _e( 'Organizer:', 'tribe-events-calendar-pro' ); ?>
  68.                 <span class="tribe-organizer"><?php echo tribe_get_organizer_link(); ?></span>
  69.         <?php } ?>
  70.  
  71.         <?php if ( $phone && tribe_get_phone() != '' ) { ?>
  72.             <span class="tel"><?php echo tribe_get_phone(); ?></span>
  73.         <?php } ?>
  74.     </div>
  75. </li><?php endwhile; ?>
  76.  <?php endif; ?>
  77.  <?php wp_reset_query();?>
Advertisement
Add Comment
Please, Sign In to add comment