Title: query_posts(&#039;&#039;) issue
Last modified: August 20, 2016

---

# query_posts('') issue

 *  [mrcreeky](https://wordpress.org/support/users/mrcreeky/)
 * (@mrcreeky)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-issue-4/)
 * Hi,
 * I need some help with a very odd problem. I have been using the code below without
   problems until today.
 *     ```
       <h2 class="home">ROAD BIKE OFFERS</h2>
       <?php $category_description_road = query_posts('cat=125&posts_per_page=4'); get_template_part( 'content','home' ); ?>
       <h2 class="home">MOUNTAIN BIKE OFFERS</h2>
       <?php $category_description_mtb = query_posts('cat=126&posts_per_page=4'); get_template_part( 'content','home' ); ?>
       <h2 class="home">TOWN & CITY BIKE OFFERS</h2>
       <?php $category_description_city = query_posts('cat=128&posts_per_page=4'); get_template_part( 'content','home' ); ?>
       ```
   
 * After adding some new posts in all 3 categories I’m not getting much of an output.
   In fact I found that each time I entered a post one was removed from the output
   using the above code.
 * Has anyone had this issue before?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-issue-4/#post-2504875)
 * [http://codex.wordpress.org/Function_Reference/query_posts](http://codex.wordpress.org/Function_Reference/query_posts)
 * I would guess at a minimum, you need to wp_reset_query after each of those loops.
 * Dunno why it would suddenly act up tho
 *  Thread Starter [mrcreeky](https://wordpress.org/support/users/mrcreeky/)
 * (@mrcreeky)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-issue-4/#post-2504881)
 * Adding that code has made no change to the output.
 * `<?php $category_description_road = query_posts('cat=125&posts_per_page=4'); 
   get_template_part( 'content','home' ); wp_reset_query();?>`
 * Would it be a better idea to control the output via the template rather than 
   how I’m doing it at the moment?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘query_posts('') issue’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [mrcreeky](https://wordpress.org/support/users/mrcreeky/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-issue-4/#post-2504881)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
