• 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

    (@eliben)

    Any ideas, anyone ?

    Try:

    <?php
    query_posts("category_name=Articles"); $wp_query->is_category = false;
    $wp_query->is_archive = false;
    ?>

    Thread Starter eliben

    (@eliben)

    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.