Advertisement
Guest User

Untitled

a guest
Dec 6th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for a venue. By default it displays venue information and lists
  4. * events that occur at the specified venue.
  5. *
  6. * You can customize this view by putting a replacement file of the same name (single-venue.php) in the events/ directory of your theme.
  7. */
  8.  
  9. // Don't load directly
  10. if ( !defined('ABSPATH') ) { die('-1'); }
  11.  
  12. ?>
  13. <?php $venue_id = get_the_id(); ?>
  14. <span class="back"><a href="<?php echo tribe_get_events_link(); ?>"><?php _e('&laquo; Back to Events', 'tribe-events-calendar-pro'); ?></a></span>
  15. <div id="tribe-events-event-meta">
  16. <div style='margin: 0 0 10px 0; float: right;'>
  17. <?php echo tribe_get_embedded_map(get_the_ID(), '690px', '400px'); ?>
  18. </div>
  19. <dl class="column location" itemscope itemtype="http://schema.org/Place">
  20. <dt class="venue-label venue-label-name"><?php _e('Name:', 'tribe-events-calendar-pro'); ?></dt>
  21. <dd itemprop="name" class="venue-meta venue-meta-name"><?php the_title(); ?></dd>
  22. <?php if(tribe_get_phone()) : ?>
  23. <dt class="venue-label venue-label-phone"><?php _e('Phone:', 'tribe-events-calendar-pro'); ?></dt>
  24. <dd itemprop="telephone" class="venue-meta venue-meta-phone"><?php echo tribe_get_phone(); ?></dd>
  25. <?php endif; ?>
  26.  
  27. <?php if( tribe_address_exists( get_the_ID() ) ) : ?>
  28. <dt class="venue-label venue-label-address">
  29. <?php _e('Address:', 'tribe-events-calendar-pro') ?><br />
  30. <?php if( get_post_meta( get_the_ID(), '_EventShowMapLink', true ) == 'true' ) : ?>
  31. <a class="gmap" itemprop="maps" href="<?php echo tribe_get_map_link(); ?>" title="<?php _e('Click to view a Google Map', 'tribe-events-calendar-pro'); ?>" target="_blank"><?php _e('Google Map', 'tribe-events-calendar-pro' ); ?></a>
  32. <?php endif; ?>
  33. </dt>
  34. <dd class="venue-meta venue-meta-address">
  35. <?php echo tribe_get_full_address( get_the_ID() ); ?>
  36. </dd>
  37. <?php endif; ?>
  38. <?php if ( get_the_content() != ''): ?>
  39. <dt class="venue-label venue-label-description"><?php _e('Description:', 'tribe-events-calendar-pro'); ?></dt>
  40. <dd class="venue-meta venue-meta-description"><?php the_content(); ?></dd>
  41. <?php endif ?>
  42. </dl>
  43. </div>
  44. <div id="tribe-events-loop" class="tribe-events-events post-list clearfix upcoming venue-events">
  45. <?php
  46. $venueEvents = tribe_get_events(array('venue'=>get_the_ID(), 'eventDisplay' => 'upcoming', 'posts_per_page' => -1));
  47. global $post;
  48. $first = true;
  49. ?>
  50. <?php if( sizeof($venueEvents) > 0 ): ?>
  51. <h2 class='tribe-events-cal-title'>Upcoming Events At This Venue</h2>
  52. <div id="tribe-events-content" class="events-archive">
  53. <?php foreach( $venueEvents as $post ):
  54. setup_postdata($post); ?>
  55. <div id="post-<?php the_ID(); ?>" <?php post_class($first ? 'tribe-events-event clearfix first': 'tribe-events-event clearfix' ); $first = false; ?> itemscope itemtype="http://schema.org/Event">
  56. <?php if ( tribe_is_new_event_day() ) : ?>
  57. <h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
  58. <?php endif; ?>
  59. <?php the_title('<h2 class="entry-title" itemprop="name"><a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark" itemprop="url">', '</a></h2>'); ?>
  60. <div class="entry-content tribe-events-event-entry" itemprop="description">
  61. <?php has_excerpt() ? the_excerpt() : the_content() ?>
  62. </div> <!-- End tribe-events-event-entry -->
  63. <div class="tribe-events-event-list-meta">
  64. <table>
  65. <?php if (tribe_is_multiday() || tribe_get_all_day() != 'yes'): ?>
  66. <tr>
  67. <td class="tribe-events-event-meta-desc"><?php _e('Start:', 'tribe-events-calendar-pro'); ?></td>
  68. <td class="tribe-events-event-meta-value"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_start_date(); ?></td>
  69. </tr>
  70. <tr>
  71. <td class="tribe-events-event-meta-desc"><?php _e('End:', 'tribe-events-calendar-pro'); ?></td>
  72. <td class="tribe-events-event-meta-value"><meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_end_date(); ?></td>
  73. </tr>
  74. <?php else: ?>
  75. <tr>
  76. <td class="tribe-events-event-meta-desc"><?php _e('Date:', 'tribe-events-calendar-pro'); ?></td>
  77. <td class="tribe-events-event-meta-value"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>" /><?php echo tribe_get_start_date(); ?></td>
  78. </tr>
  79. <?php endif; ?>
  80. <?php
  81. $cost = tribe_get_cost();
  82. if ( !empty( $cost ) ) :
  83. ?>
  84. <tr>
  85. <td class="tribe-events-event-meta-desc"><?php _e('Cost:', 'tribe-events-calendar-pro'); ?></td>
  86. <td class="tribe-events-event-meta-value" itemprop="price"><?php echo $cost; ?></td>
  87. </tr>
  88. <?php endif; ?>
  89. </table>
  90. </div>
  91. </div> <!-- End post -->
  92. <?php endforeach; ?>
  93. <?php endif; ?>
  94. <?php // Reset the post and id to the venue post before comments template shows up.
  95. $post = get_post($venue_id);
  96. global $id;
  97. $id = $venue_id;?>
  98. </div>
  99. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement