Guest User

Untitled

a guest
Apr 16th, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.                         // Find connected posts
  3.                         $connected = new WP_Query( array(
  4.                           'connected_type' => 'golfs_to_sejours',
  5.                           'connected_items' => get_queried_object_id(),
  6.                           'nopaging' => true,
  7.                           'post_type' => 'golf',
  8.                         ) );
  9.                        
  10.                         // Display connected posts
  11.                         if ( $connected->have_posts() ) :
  12.                         ?>
  13.                         <?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
  14.                            
  15.                             <div class="alignleft golf">
  16.                                     <h3><?php the_title(); ?></h3>
  17.                                 <?php if ( has_post_thumbnail() ) { the_post_thumbnail('sejours-thumbnails', array('class' => 'alignright')); } ?>
  18.  
  19.                                 <div class="golf-listing">
  20.                                     <?php the_content(); ?>
  21.                                     <?php comments_template(); ?>
  22.                                    
  23.                                     <?php $related = p2p_type( 'golfs_courses' )->get_related( get_queried_object_id() ); ?>
  24.  
  25.                                 </div>
  26.                            
  27.                             </div>
  28.                            
  29.                         <?php endwhile; ?>
  30.                        
  31.                         <?php
  32.                         // Prevent weirdness
  33.                         wp_reset_postdata();
  34.                        
  35.                         endif;
  36.                         ?>
Advertisement
Add Comment
Please, Sign In to add comment