Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
$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.

share|improve this question
1  
check error logs, you're probably running out of memory if you're trying to load 1600 posts at once. –  Milo Jun 24 '13 at 15:26
    
Guess I should have considered that before posting, that's where it's breaking although in both instances it's set to 128M. That's a pretty big number to break, weird it only exceeds that limit on my vps I'll bump it up to 512. –  Corey Rowell Jun 24 '13 at 16:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.