Title: query_posts and conditional tag tests?
Last modified: August 18, 2016

---

# query_posts and conditional tag tests?

 *  [danny21k](https://wordpress.org/support/users/danny21k/)
 * (@danny21k)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/query_posts-and-conditional-tag-tests/)
 * I’m having trouble getting a conditional test to work as it should, i’ve included
   the part of the code that seems to be relevant bellow, if the ‘Category_Cloud_Mini’
   function was not there then the conditional test works, if the function is in
   the page before the test then every page tests as the ‘home’ page, including 
   single & category pages,
 * assuming that it’s the ‘query_posts’ thing that’s causing the problem, i’d be
   grateful if anyone could tell me why its causing the conditional test to go wrong?
 * thanks for any help with this,
 *     ```
       function Category_Cloud_Mini() {
                   foreach((query_posts('showposts=25')) as $post) {
                   }
               }
               Category_Cloud_Mini();
       ```
   
 * followed by:
 *     ```
       if (is_home()) {
                   echo "ON HOME PAGE";
               }
               elseif (is_single()) {
                   echo "ON SINGLE PAGE";
               }
               elseif (is_category()) {
                   echo "ON CATEGORY PAGE";
               }
       ```
   

Viewing 1 replies (of 1 total)

 *  [zackkline](https://wordpress.org/support/users/zackkline/)
 * (@zackkline)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/query_posts-and-conditional-tag-tests/#post-638021)
 * I was trying to do something similar…list pages in the sidebar and query post
   seemed to mess it up too. In fact, in looking for the solution, I came across
   your post, so I’ll let you know if I find out how to fix it.

Viewing 1 replies (of 1 total)

The topic ‘query_posts and conditional tag tests?’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * 1 reply
 * 2 participants
 * Last reply from: [zackkline](https://wordpress.org/support/users/zackkline/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/query_posts-and-conditional-tag-tests/#post-638021)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
