Advertisement
FlyFX

Related Photos Sidebar

Jan 24th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php $the_query = new WP_Query( array('post_type' => 'images') );?>
  2.         <?php $mix_venue = get_post_meta(get_the_ID(), 'mix_venue', true); ?>    
  3.         <div class="nwidget-container"><h2 class="nwidget-title"><?php echo $mix_venue ?></h2></div>
  4.            
  5.         <?php
  6.        
  7.             // The Loop
  8.             while ( $the_query->have_posts() ) :
  9.             $the_query->the_post();
  10.             ?>
  11.            
  12.             <?php  
  13.                     $img = get_post_meta(get_the_ID(), 'wp_image_attachment', true);
  14.                     $image_venue = get_post_meta(get_the_ID(), 'image_venue', true);
  15.                     $image_date = get_post_meta(get_the_ID(), 'image_date', true);
  16.                    
  17.             ?>
  18.          <?php if (($image_venue == $mix_venue)){ ?>
  19.             <div class="event_images_sidebar">
  20.            
  21.           <a href="<?php echo $img['url'] ?>" rel="lightbox" title="<?php echo $image_venue ?>"><img src="<?php echo $img['url'] ?>" height="50px" width="50px" /></a>
  22.            
  23.            
  24.         </div><!-- #post-## -->
  25.        
  26.         <?php } else echo ''; ?>
  27.             <?php endwhile;
  28.            
  29.    
  30.             // Restore original Query & Post Data
  31.             wp_reset_query();
  32.             wp_reset_postdata();
  33.  
  34.            
  35.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement