Title: query_posts causing page load delay &#8211; Best alternative?
Last modified: August 20, 2016

---

# query_posts causing page load delay – Best alternative?

 *  [Pendulum](https://wordpress.org/support/users/pendulum/)
 * (@pendulum)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/query_posts-causing-page-load-delay-best-alternative/)
 * I’m currently using query_posts to select posts with a specific tag to display.
   I have to do this a total of 6 times on one page, with a different tag being 
   pulled each time.
 * I know there’s got to be a better way to do this… I’m getting some page load 
   delays from the code below. Any help is greatly appreciated!
 *     ```
       <?php query_posts('tag=home_1&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
   
       						<?php query_posts('tag=home_2&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
   
       						<?php query_posts('tag=home_3&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
   
       						<?php query_posts('tag=home_4&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
   
       						<?php query_posts('tag=home_5&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
   
       						<?php query_posts('tag=home_6&category=1&posts_per_page=1'); ?>
   
       						<?php while (have_posts()) : the_post(); ?>
   
       							<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
       								<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumbnails' ); ?>
       						    	<header class="article-header">
   
       							    	<h1><?php the_title(); ?><img src="/wp-content/themes/az***/library/images/arrows.png" class="arrow" alt="Post Arrows" title="post arrows" /></a></h1>
   
       						    	</header><!-- end article header -->
   
       					   		 </article><!-- end article -->
   
       						<?php endwhile; ?>
   
       						<?php rewind_posts; ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [touchrandr](https://wordpress.org/support/users/touchrandr/)
 * (@touchrandr)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/query_posts-causing-page-load-delay-best-alternative/#post-3221126)
 * Hi,
 * I use the below code to get different post type, but my page loads,
    it sucks
   my whole system process.
 * $args = array(
    ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘
   post-faq’, ‘post_status’ => ‘publish’ );
 * return $faq_array = query_posts( $args );
 * We can try the WP_Query()
    [WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query)

Viewing 1 replies (of 1 total)

The topic ‘query_posts causing page load delay – Best alternative?’ is closed to
new replies.

## Tags

 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * 1 reply
 * 2 participants
 * Last reply from: [touchrandr](https://wordpress.org/support/users/touchrandr/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/query_posts-causing-page-load-delay-best-alternative/#post-3221126)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
