View difference between Paste ID: vVWwYcR4 and 3z3RpsVN
SHOW: | | - or go back to the newest paste.
1
<?php
2
		// Find connected shows
3
		$connected = new WP_Query( array(
4
			'post_type' => 'tscf-show',
5
			'connected_type' => 'show2troupe',
6
			'connected_items' => get_queried_object_id(),
7
			'connected_direction' => 'to',
8
			'meta_key' => 'date__time',
9
			'orderby' => 'meta_value',
10
			'order' => 'asc',
11
		) );
12
		
13
		?>
14
          <div class="troupe-show">
15
            <div class="block-title">See Them<span class="bold caps">Live!</span></div>
16
            
17
            <!--/block-title-->
18
            
19
            <?php // Display show dates  ?>
20
            <ul class="troupe-show-list">
21
              <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
22
              <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>
23
                <?php 
24
			  $url = get_post_meta($post->ID, 'advance_tickets_url', true);
25
			  $soldOut = get_post_meta($post->ID, 'sold_out', true);
26
			  if(!empty($soldOut)){// "Sold Out" is not checked
27
				  echo '<div class="troupe-tix-msg"><span class="semiBold purple caps" style="font-size:16px;">Sold Out</span><br />
28
<span class="purple" style="font-size: 11px;">(ltd. tix may be avail. at the door)</span></div>'; //Show Sold Out message
29
			  }elseif(!empty($url)) {// otherwise, if the ticket url is present
30
              echo '<a href="'.$url.'" target="_blank"> 
31
              <div class="troupe-tix"></div>
32
              </a>';// Show BUY TIX link box w/ url as entered
33
			  }else{
34
				echo '<div class="troupe-tix-msg"><span class="semiBold blue caps" style="font-size:16px;">Tix Onsale Soon</span></div>'; //Show Onsale Soon message
35
			  }
36
			  
37
			  ?>
38
                <?php
39
40
			// Nested loop - to find the Venue connected to this Show
41
			$venueShowConnected = new WP_Query( array(
42
				'post_type' => 'venues',
43
				'connected_type' => 'show2venue',
44
				'connected_items' => $post->ID,
45
				'connected_direction' => 'any',
46
				'nopaging' => true,
47
			) );
48
			$referenceID = $post->ID;
49
			// Display connected Venues
50
			?>
51
                <?php while ( $venueShowConnected->have_posts() ) : $venueShowConnected->the_post(); ?>
52
                <span class="troupe-show-venue"><a href="<?php the_permalink(); ?>">
53
                <?php the_title(); ?>
54
                </a></span><br />
55
                <span class="troupe-show-address">(<?php echo get_post_meta($post->ID, 'address', true); ?>)</span><br />
56
                <?php endwhile; ?>
57
                <?php // Prevent weirdness
58
			wp_reset_postdata();
59-
			// END Nested loop - to find the Venue connected to this Show
59+
			// END Nested loop - to get all troupes on this bill
60
			?>
61
                <div class="troupe-show-featuring">Featuring: </div>
62
                <!--/troupe-show-featuring-->
63
                <div class="troupe-show-troupelist">
64
                  <ul>
65
                    <?php $temp_query = $wp_query; 
66
				
67
					// Nested loop - to find the troupes connected to this Show
68
					$troupesConnected = new WP_Query( array(
69
					'post_type' => 'tscf-troupes',
70
					'connected_type' => 'show2troupe',
71
					'connected_items' => $post->ID,
72
					'connected_direction' =>'any',
73
					'nopaging' => true,
74
				    ) );
75
			
76
					// Display connected Troupes
77
			
78
					while ($troupesConnected->have_posts()) : $troupesConnected->the_post();
79
		
80
					?>
81
                    <li><a href="<?php the_permalink(); ?>">
82
                      <?php the_title(); ?>
83
                      </a></li>
84
                    <!-- Do special_cat stuff... -->
85
                    <?php endwhile; 
86
				
87
					$wp_query = $temp_query; 
88
					?>
89
                  </ul>
90
                </div>
91
                <!--/troupe-show-troupelist--> 
92
                
93
              </li>
94
              <?php endwhile; ?>
95
            </ul>
96
            <?php // Prevent weirdness
97
			wp_reset_postdata(); ?>
98-
          </div>
98+
          </div>
99
          <!--/troupe-show-->