query_posts in 2.1?
-
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?
- The topic ‘query_posts in 2.1?’ is closed to new replies.