Title: Fooling is_archive()
Last modified: August 18, 2016

---

# Fooling is_archive()

 *  [eliben](https://wordpress.org/support/users/eliben/)
 * (@eliben)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/fooling-is_archive/)
 * Hello,
 * I’ve written a page template for some page on my website. This page template 
   displays some things, among which is a listing of all posts from some category.
   I see that the sidebar treats this page as ‘is_archive’, although I don’t want
   it to. I suspect this is because I call ‘query_posts’ in the template, like this:
 * `<?php query_posts("category_name=Articles"); ?>`
    `while (have_posts()) : the_post();?
   >` … … `<?php endwhile; ?>`
 * I don’t want this page to be detected as “is_archive”. How can I do this ?
 * Thanks

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

 *  Thread Starter [eliben](https://wordpress.org/support/users/eliben/)
 * (@eliben)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/fooling-is_archive/#post-373596)
 * Any ideas, anyone ?
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/fooling-is_archive/#post-373603)
 * Try:
 * `<?php 
    query_posts("category_name=Articles"); $wp_query->is_category = false;
   $wp_query->is_archive = false;  ?>
 *  Thread Starter [eliben](https://wordpress.org/support/users/eliben/)
 * (@eliben)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/fooling-is_archive/#post-373705)
 * This works, in fact I found another solution a couple of hours ago:
 * $wp_query->is_page = true;
 * I was just hoping there would be a cleaner way :-/

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

The topic ‘Fooling is_archive()’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [eliben](https://wordpress.org/support/users/eliben/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/fooling-is_archive/#post-373705)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
