• Resolved robdeluxe

    (@robdeluxe)


    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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter robdeluxe

    (@robdeluxe)

    I’ve tried using $wpdb as well but just can’t get posts from certain categories ok. I’m no good with inner joins ??

    Thread Starter robdeluxe

    (@robdeluxe)

    Closing this one and reopened a new one with my comments combined.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unlimited loop query appears to timeout’ is closed to new replies.