Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php
  2. $terms = get_the_terms( $post->ID, 'reources-category' );?>
  3. <?php $arg = array(
  4. 'post_type' => 'resources-directory',
  5. 'order' => 'ASC',
  6. 'orderby' => 'title',
  7. 'posts_per_page' => -1,
  8. 'tax_query' => array(
  9. 'relation' => 'AND',
  10. array(
  11. 'taxonomy' => 'reources-category',
  12. 'field' => 'slug',
  13. 'terms' => $terms
  14. ))
  15. );
  16. $the_query = new WP_Query( $arg );
  17. if ( $the_query->have_posts() ) : ?>
  18.  
  19. <?php while ( $the_query->have_posts() ) : $the_query->the_post();
  20. $do_not_duplicate = $post->ID; ?><!-- BEGIN of Post -->
  21.  
  22. <h3><?php the_title(); ?></h3>
  23. <?php the_content(); ?>
  24. <?php endwhile; ?><!-- END of Post -->
  25.  
  26. <?php endif; wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement