Title: query_posts in 2.1?
Last modified: August 18, 2016

---

# query_posts in 2.1?

 *  Resolved [andrewkhunn](https://wordpress.org/support/users/andrewkhunn/)
 * (@andrewkhunn)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/query_posts-in-21/)
 * Was there a change made to the `query_posts` function such that it is know breaking
   after upgrading from 2.05 to 2.1? The following code is meant to do a lookup 
   for a page which has a specific parent (the “Sidebars” category) and name which
   matches the name of the page we’re currently on.
 * `<?php
    $sidebar_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent
   = '30' AND post_name = '$post->post_name'"); query_posts('page_id='.$sidebar_id.'');
   if ( $sidebar_id != '' ) : if ( have_posts() ) : while ( have_posts() ) : the_post();?
   > <div id="post_meta" class="prominent reduced"><div class="inner"> <?php the_content();?
   > </div></div> <?php endwhile; endif; else: ?> <div id="post_meta" class="prominent
   reduced"><div class="inner"> <h3>Upcoming Events</h3> <p><?php showImage(); ?
   ></p> </div></div> <?php endif; ?>
 * This was successfully working previously. What changed?

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

 *  [JaneLitte](https://wordpress.org/support/users/janelitte/)
 * (@janelitte)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/query_posts-in-21/#post-509947)
 * Do you have the Adhesive plugin? That might be causing problems.
 *  Thread Starter [andrewkhunn](https://wordpress.org/support/users/andrewkhunn/)
 * (@andrewkhunn)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/query_posts-in-21/#post-509948)
 * Holy crap. I was pulling my hair out.
 * Adhesive was indeed causing the issues. I thought it was 2.1-compatible. Guess
   I’ll wait for an update.
 * Thanks so much!

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

The topic ‘query_posts in 2.1?’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [andrewkhunn](https://wordpress.org/support/users/andrewkhunn/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/query_posts-in-21/#post-509948)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
