Title: query posts multiple queries
Last modified: August 19, 2016

---

# query posts multiple queries

 *  Resolved [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/)
 * How do I modify this line to also exclude a category?
 * <?php query_posts($query_string.’&orderby=title&order=ASC’); while (have_posts()):
   the_post(); ?>

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

 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954096)
 * [http://codex.wordpress.org/Template_Tags/query_posts](http://codex.wordpress.org/Template_Tags/query_posts)
 * to exclude a category you write `cat=-3` notice the ‘-‘ before the category ID.
 *  Thread Starter [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954102)
 * Im having trouble working that into the same line:
 * query_posts($query_string.’&orderby=title&order=ASC’, ‘cat=-Archive’);
 * is that correct?
 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954104)
 * try using the category ID instead of the name and try this line:
 * `query_posts('orderby=title&order=ASC&cat=-ID#');`
 * where ID# is the ID of ‘Archive’. You can look in the admin panel under manage-
   > categories and find the ID# there.
 *  Thread Starter [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954110)
 * Im using wp 2.7 and I cant see id numbers for the categories
 *  Thread Starter [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954129)
 * category_name=- doesnt seem to work
 * query_posts($query_string.’orderby=title&order=ASC&category_name=-Archive’)
 *  [mores](https://wordpress.org/support/users/mores/)
 * (@mores)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954134)
 * When in the dashboard, edit the categories. When you move your mouse over the
   existing categories, you’ll see the ID in the URL that is displayed in most browsers’
   status area, usually lower left.
 *  Thread Starter [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954138)
 * Ah I see the id number now. Still not got a solution. All I want to do is exclude
   a category from my home page (index.php)
 * <?php if (have_posts()) : ?>
 *  <?php query_posts($query_string.’orderby=title&order=ASC’); while (have_posts()):
   the_post(); ?>
 *  Thread Starter [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * (@futurekode)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954152)
 * I used a plugin instead
 * Thanks

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

The topic ‘query posts multiple queries’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [Mark Steggles](https://wordpress.org/support/users/futurekode/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/query-posts-multiple-queries/#post-954152)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
