Force Conditional Tags – query_posts
-
I’ve searched the archives and can’t assemble a complete picture. A number of people have asked about this.
It is clear that using query_posts() messes up any subsequent use of conditional tags in 2.3.2 WordPress – any dissension here?
Maybe this is by design but regardless it is impacting the functionality of my sidebar.
This is what I am using now on an archive Page that simply displays all posts except those from one category.
<?php if (is_page()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 0; query_posts("cat=-3&posts_per_page=50&paged=$paged"); global $more; // set $more to 0 in order to only get the first part of the post $more = 0; ?>I found the $more = 0 in the codex. It forces the more tag to be respected in the loop.
Any call to conditional tags afterwards is_home, is_archive, is_page don’t yield the expected results.
I’m looking to understand the following:
- What values are returned for the is_home, is_archive, is_page, is_single, is_tag.
- How do I manually force a conditional tag setting, much like the $more hack?
The topic ‘Force Conditional Tags – query_posts’ is closed to new replies.