The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] query_posts in 2.1? (3 posts)

  1. andrewkhunn
    Posted 9 years ago #

    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.

    $sidebar_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '30' AND post_name = '$post->post_name'");
    if ( $sidebar_id != '' ) :
    if ( have_posts() ) : while ( have_posts() ) : the_post();
    <div id="post_meta" class="prominent reduced"><div class="inner">
    <?php the_content(); ?>
    <?php endwhile; endif; else: ?>
    <div id="post_meta" class="prominent reduced"><div class="inner">
    <h3>Upcoming Events</h3>
    <p><?php showImage(); ?></p>
    <?php endif; ?>

    This was successfully working previously. What changed?

  2. JaneLitte
    Posted 9 years ago #

    Do you have the Adhesive plugin? That might be causing problems.

  3. andrewkhunn
    Posted 9 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic