WP_Query Results Issue
-
Hi
I have the following query set up
$argsar = array ( 'numberposts' => 1, 'post_type' => 'auctionroom', 'meta_key' => 'auctionroom_username', 'compare' => '=', 'value' => $auctionroomname ); $the_queryar = new WP_Query($argsar); if ($the_queryar->have_posts()) { $causercheck = $the_queryar->found_posts; $the_queryar->the_post(); $auctionroom_id = get_the_ID(); }
It should only return 1 result but it is returning the total number of auctionroom posts when I get
$causercheck = $the_queryar->found_posts;
Having numberposts or not gives the same incorrect total
Thanks in anticipation for any clues
Running
Wordpress Version: 5.5.1
ACF Version: 5.9.1
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP_Query Results Issue’ is closed to new replies.