$args = array( 'posts_per_page'=> -1, 'post_type' => 'listing', 'meta_query' => array( array( 'key' => 'ListingRid', 'value' => $listing_ids, 'compare' => 'IN' ) ) ); $query = get_posts( $args );
I'm pulling home listings from a remote server and inserting them as custom posts into Wordpress. Only active listings are made available, to update the posts and clear the expired ones I grab an array of all active
'ListingRid' from the server and put them in an array (have also tried a comma separated string) in
$listing_ids and compare that array with what I currently have in my Wordpress db, then do a
posts__not_in check and delete those posts that it returns.
This snippet works fine on localhost running wamp server. When I run it on my vps (ubuntu) as soon as my script hits this block nothing after it is executed. If I remove the
'posts_per_page' => -1, line it works, but as expected only returns 5 posts when I need it to return ~1,600.