Query within a foreach within a query (queryception)
Good for you that you’ve corrected the $posts that was undefined, but then: There’s no need to call $the_query->get_posts() because when WP_Query is instantiated with a non-empty query, e.g. new WP_Query( ‘post_type=house’ ) (contains one query arg — post_type) as opposed to new WP_Query() (no query args specified), the get_posts() method in that class will … Read more