I am working on some rather elaborate comparisons between metadata and having a bit of trouble correctly referring to results from my query. The first query to establish
$team_is_home works fine but as soon as I try to capture the ID of the posts where the
$team_is_homeit goes a bit haywire and I get warnings saying: "Undefined property: WP_Query::$post "
$args = array( 'post_type' => 'match_report', 'post_status' => 'publish', 'meta_query' => array( array( 'key' => 'report_home-select', 'value' => $team_id, 'compare' => '=', ), ) ); $hometeams = new WP_Query($args); $team_is_home = $hometeams->found_posts; $scorehome = get_post_meta($hometeams->post->ID, 'report_homescore');
How should I be reffering to
$hometeams->post->ID to avoid getting this warning?