Guest User

Untitled

a guest
Nov 2nd, 2012
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2.  
  3. // Vars set:
  4. // '$event->AllDay',
  5. // '$event->StartDate',
  6. // '$event->EndDate',
  7. // '$event->ShowMapLink',
  8. // '$event->ShowMap',
  9. // '$event->Cost',
  10. // '$event->Phone',
  11.  
  12. // Don't load directly
  13. if ( !defined('ABSPATH') ) { die('-1'); }
  14.  
  15. $event = array();
  16. $tribe_ecp = TribeEvents::instance();
  17. reset($tribe_ecp->metaTags); // Move pointer to beginning of array.
  18. foreach($tribe_ecp->metaTags as $tag){
  19. $var_name = str_replace('_Event','',$tag);
  20. $event[$var_name] = tribe_get_event_meta( $post->ID, $tag, true );
  21. }
  22.  
  23. $event = (object) $event; //Easier to work with.
  24.  
  25. ob_start();
  26. post_class($alt_text,$post->ID);
  27. $class = ob_get_contents();
  28. ob_end_clean();
  29. ?>
  30. <div class="event">
  31. <?php if(has_post_thumbnail($post->ID, 'thumbnail')):
  32. $image_id = get_post_thumbnail_id($post->ID);
  33. $image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?>
  34. <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>
  35. <?php endif; ?>
  36. <a href="<?php echo get_permalink($post->ID) ?>"><?php echo $post->post_title ?></a>
  37. </div>
  38. <div class="when">
  39. <?php
  40. echo tribe_get_start_date( $post->ID, isset($start) ? $start : null );
  41.  
  42. if($event->AllDay && $start)
  43. echo ' <small>('.__('All Day','tribe-events-calendar-pro').')</small>';
  44. ?>
  45. </div>
  46. <div class="loc">
  47. <?php
  48. if ( tribe_get_city() != '' ) {
  49. echo tribe_get_city() . ', ';
  50. }
  51. if (tribe_get_region() != '') {
  52. echo tribe_get_region() . ', ';
  53. }
  54. if (tribe_get_country() != '') {
  55. echo tribe_get_country();
  56. }
  57. ?>
  58. </div>
  59. <div class="event_body">
  60. <?php the_content('... More');?>
  61. </div>
  62. <?php $alt_text = ( empty( $alt_text ) ) ? 'alt' : ''; ?>
Advertisement
Add Comment
Please, Sign In to add comment