Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tax_country = strip_tags( get_the_term_list($post->ID, 'country') );
- echo '<h1>More Properties in ';
- echo $tax_country;
- echo '...</h1>';
- $relates = get_posts(array(
- 'post_type' => 'propertyawardwinners',
- 'numberposts' => -1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'country',
- 'field' => 'slug',
- 'terms' => array($tax_country),
- 'include_children' => false
- )
- )
- ));
- foreach ($relates as $relate) {
- echo $relate->post_title . '<br/>';
- echo $relate->ID . '<br/>';
- echo get_field('location_city') . '<br/><br/>';
- }
- ?>
- $tax_country = wp_get_post_terms( $post->ID, 'country', array( 'fields' => 'ids' ) );
- 'tax_query' => array(
- array(
- 'taxonomy' => 'country',
- 'terms' => $tax_country,
- 'include_children' => false
- )
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement