Advertisement
alchymyth

query

Apr 25th, 2012
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. $args = array('post_type' => 'productions',
  3.    'tax_query' => array (
  4.       array ( 'taxonomy' => 'directors',
  5.          'field'    => 'id',
  6.          'terms'    => get_the_ID()
  7.       )
  8.    ));
  9. $query = new WP_Query( $args );
  10. // The Query
  11. $the_query = new WP_Query( $args );
  12. // The Loop
  13.  
  14. if ( $the_query->have_posts() ) :
  15. echo "<p>Productions:&nbsp;";
  16.  
  17. while ( $the_query->have_posts() ) : $the_query->the_post();
  18. ?>
  19. <?php echo (($the_query->current_post!=0)?', ':''); ?><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><?php endwhile;
  20. echo "</p>";
  21. endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement