Unlimited loop query appears to timeout
-
Hi,
I need to create a page with a summary of all of my reviews on my site. Just need title, author and url (in XML or HMTL format).
I have crudely tried to do this by creating the following page template…<?php /* Template Name: FilmReviewSummary */ ?> <?php $myPosts = new WP_Query(); $myPosts-> query (array ( 'category_name' => 'film-reviews','posts_per_page'=>-1 ) ); while ($myPosts->have_posts()) : $myPosts->the_post(); the_author(); the_permalink(); endwhile; ?>
I currently have approx. 2000 reviews, it seems that the query timesout if I start to request more than say 1200 in the posts_per_page. Do you know why this is? I imagine it isn’t a very well performing query but ti shouldn’t get used much, it is just for another site to harvest our review links once a week. Maybe I should build the page via a job on the server somehow rather than dynamically with each load, but I’m not sure how I would go about that.
Thanks,
Rob[bumps moderated]
- The topic ‘Unlimited loop query appears to timeout’ is closed to new replies.