Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Find connected shows
- $connected = new WP_Query( array(
- 'post_type' => 'tscf-show',
- 'connected_type' => 'show2troupe',
- 'connected_items' => get_queried_object_id(),
- 'connected_direction' => 'to',
- 'meta_key' => 'date__time',
- 'orderby' => 'meta_value',
- 'order' => 'asc',
- ) );
- ?>
- <div class="troupe-show">
- <div class="block-title">See Them<span class="bold caps">Live!</span></div>
- <!--/block-title-->
- <?php // Display show dates ?>
- <ul class="troupe-show-list">
- <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
- <li class="group"><span class="troupe-show-date"><a href="<?php the_permalink(); ?>"><?php echo date("F j, Y - g:ia",strtotime(get_post_meta($post->ID, 'date__time', true))); ?></a></span><br>
- <?php
- $url = get_post_meta($post->ID, 'advance_tickets_url', true);
- $soldOut = get_post_meta($post->ID, 'sold_out', true);
- if(!empty($soldOut)){// "Sold Out" is not checked
- echo '<div class="troupe-tix-msg"><span class="semiBold purple caps" style="font-size:16px;">Sold Out</span><br />
- <span class="purple" style="font-size: 11px;">(ltd. tix may be avail. at the door)</span></div>'; //Show Sold Out message
- }elseif(!empty($url)) {// otherwise, if the ticket url is present
- echo '<a href="'.$url.'" target="_blank">
- <div class="troupe-tix"></div>
- </a>';// Show BUY TIX link box w/ url as entered
- }else{
- echo '<div class="troupe-tix-msg"><span class="semiBold blue caps" style="font-size:16px;">Tix Onsale Soon</span></div>'; //Show Onsale Soon message
- }
- ?>
- <?php
- // Nested loop - to find the Venue connected to this Show
- $venueShowConnected = new WP_Query( array(
- 'post_type' => 'venues',
- 'connected_type' => 'show2venue',
- 'connected_items' => $post->ID,
- 'connected_direction' => 'any',
- 'nopaging' => true,
- ) );
- $referenceID = $post->ID;
- // Display connected Venues
- ?>
- <?php while ( $venueShowConnected->have_posts() ) : $venueShowConnected->the_post(); ?>
- <span class="troupe-show-venue"><a href="<?php the_permalink(); ?>">
- <?php the_title(); ?>
- </a></span><br />
- <span class="troupe-show-address">(<?php echo get_post_meta($post->ID, 'address', true); ?>)</span><br />
- <?php endwhile; ?>
- <?php // Prevent weirdness
- wp_reset_postdata();
- // END Nested loop - to get all troupes on this bill
- ?>
- <div class="troupe-show-featuring">Featuring: </div>
- <!--/troupe-show-featuring-->
- <div class="troupe-show-troupelist">
- <ul>
- <?php $temp_query = $wp_query;
- // Nested loop - to find the troupes connected to this Show
- $troupesConnected = new WP_Query( array(
- 'post_type' => 'tscf-troupes',
- 'connected_type' => 'show2troupe',
- 'connected_items' => $post->ID,
- 'connected_direction' =>'any',
- 'nopaging' => true,
- ) );
- // Display connected Troupes
- while ($troupesConnected->have_posts()) : $troupesConnected->the_post();
- ?>
- <li><a href="<?php the_permalink(); ?>">
- <?php the_title(); ?>
- </a></li>
- <!-- Do special_cat stuff... -->
- <?php endwhile;
- $wp_query = $temp_query;
- ?>
- </ul>
- </div>
- <!--/troupe-show-troupelist-->
- </li>
- <?php endwhile; ?>
- </ul>
- <?php // Prevent weirdness
- wp_reset_postdata(); ?>
- </div>
- <!--/troupe-show-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement