Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php if (have_posts()) : while (have_posts()) : the_post();
  4. global $post;
  5. ?>
  6.  
  7. <?php $city_id = get_the_ID(); ?>
  8.  
  9. <h4>Недвижимость, размещенная в городе:</h4>
  10.  
  11. <?php
  12. $query = new WP_Query(array(
  13. 'post_type' => 'estate',
  14. 'meta_query' => array(
  15. array(
  16. 'key' => 'estate_city',
  17. 'value' => $city_id
  18. )
  19. ),
  20. 'orderby' => 'title',
  21. 'order' => 'ASC'
  22. ));
  23. if ( $query->have_posts() ) :
  24. while ( $query->have_posts() ) : $query->the_post();
  25. global $post;
  26. $metaboxes_data = get_post_meta($post->ID, 'estate-metaboxes', true); ?>
  27.  
  28. <?php the_title(); ?>
  29.  
  30. <?php endwhile;
  31. endif;
  32. wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement