• Resolved andrewkhunn

    (@andrewkhunn)


    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)
  • Do you have the Adhesive plugin? That might be causing problems.

    Thread Starter andrewkhunn

    (@andrewkhunn)

    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.