WP_Query timing out.
-
On my single post, I am trying to add 6 additional images after the post which are in the same category. I created the query below which does return 6 random images from the same category as the post.
However, for some reason the query is stuck in some type of infinite loop and eventually times out.
Can anyone tell me what is going on with this query which would cause it to time out?
$the_query = new WP_Query( array ( 'category_name'=>$category[0]->cat_name, 'posts_per_page'=>'6', 'post__not_in' =>array( $post->ID), 'orderby' => 'rand')); while ( have_posts() ) : $the_query->the_post(); the_post_thumbnail('random-6', array('class' => 'random-six')); endwhile;
Thanks!!
–christopher
Here is a link to the page where you can see the time out.
https://theviolent.net/inspirational/angels-are-watching
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP_Query timing out.’ is closed to new replies.