Title: A looping question &#8212; query posts
Last modified: August 19, 2016

---

# A looping question — query posts

 *  [bnther](https://wordpress.org/support/users/bnther/)
 * (@bnther)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/a-looping-question-query-posts/)
 * This is my first time at WordPress and I’m using it to build a website (not a
   blog)…please don’t flame me for improper usage : )
 * I’m using the query_post(category) to display my dynamic content. I’ve got two
   seperate div’s, each with a query for a separate category. I’ve got it done and
   it’s working, but I read that _“Use of query\_posts on Loops other than the main
   one can result in your main Loop becoming incorrect and possibly displaying things
   that you were not expecting.”_ This would be bad.
 * Am I doing this?
 * <div id=”title”>Otsego Chamber of Commerce</div>
 *  <div id=”content”>
    <div id=”news”> <?php query_posts(‘category_name=News’);?
   > <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?> <?php the_content();?
   > <?php endwhile; else:?> <p> nothing doing</p> <?php endif; ?> <?php wp_reset_query();?
   > </div>
 *  <div id=”chamberInfo”>
    <?php query_posts(‘category_name=Chamber Info’);?> <?
   php if ( have_posts() ) : while ( have_posts() ) : the_post();?> <?php the_content();?
   > <?php endwhile; else:?> <p> nothing doing</p> <?php endif; ?> <?php wp_reset_query();?
   > </div> </div>

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

 *  [Safirul Alredha](https://wordpress.org/support/users/zeo/)
 * (@zeo)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/a-looping-question-query-posts/#post-1469951)
 * Looks okay since u use `wp_reset_query()`
 *  Thread Starter [bnther](https://wordpress.org/support/users/bnther/)
 * (@bnther)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/a-looping-question-query-posts/#post-1469952)
 * Thanks for the reply. It’d be just my luck to go ‘live’ with this thing and have
   it fall apart.

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

The topic ‘A looping question — query posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [bnther](https://wordpress.org/support/users/bnther/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/a-looping-question-query-posts/#post-1469952)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
