Advertisement
Guest User

Untitled

a guest
Apr 17th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. $tax_country = strip_tags( get_the_term_list($post->ID, 'country') );
  4.  
  5. echo '<h1>More Properties in ';
  6. echo $tax_country;
  7. echo '...</h1>';
  8.  
  9. $relates = get_posts(array(
  10. 'post_type' => 'propertyawardwinners',
  11. 'numberposts' => -1,
  12. 'tax_query' => array(
  13. array(
  14. 'taxonomy' => 'country',
  15. 'field' => 'slug',
  16. 'terms' => array($tax_country),
  17. 'include_children' => false
  18. )
  19. )
  20. ));
  21.  
  22. foreach ($relates as $relate) {
  23. echo $relate->post_title . '<br/>';
  24. echo $relate->ID . '<br/>';
  25. echo get_field('location_city') . '<br/><br/>';
  26.  
  27. }
  28.  
  29. ?>
  30.  
  31. $tax_country = wp_get_post_terms( $post->ID, 'country', array( 'fields' => 'ids' ) );
  32.  
  33. 'tax_query' => array(
  34. array(
  35. 'taxonomy' => 'country',
  36. 'terms' => $tax_country,
  37. 'include_children' => false
  38. )
  39. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement