Title: WP query categories?
Last modified: August 21, 2016

---

# WP query categories?

 *  [iigor](https://wordpress.org/support/users/iigor/)
 * (@iigor)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/wp-query-categories/)
 * <?php
    $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query-
   >query(‘&paged=’.$paged); ?> <?php while ($wp_query->have_posts()) : $wp_query-
   >the_post(); ?>
 * **This is for home page right?**
    Now i want to implement this to categories 
   in archive.php but i dont know how. When i enter code above to archive.php it
   shows home page posts (all posts) in every category. How to make it work?

Viewing 1 replies (of 1 total)

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/wp-query-categories/#post-3699464)
 * You have to set up your conditional arguments in your query.
 * Check this codex page:
    [http://codex.wordpress.org/Function_Reference/query_posts](http://codex.wordpress.org/Function_Reference/query_posts)

Viewing 1 replies (of 1 total)

The topic ‘WP query categories?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Josh](https://wordpress.org/support/users/josh401/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/wp-query-categories/#post-3699464)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
