Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to use the loop inside custom post settings.
However this results in several errors the most common being the following: when I click on a post on the admin it always goes to the the last post.

The code that I use is:

$original_query = $wp_query;
$wp_query = null;
$args = array( 'nopaging' => true, 'cat' => $e->cat_ID );
$wp_query = new WP_Query( $args );
while ( $wp_query->have_posts() ) : $wp_query->the_post();
   $output .= '<option>'.get_the_title().'</option>';

$wp_query = null;
$wp_query = $original_query;

any help would be very much appreciated!!


merged by Rarst Jul 4 '11 at 10:04

This question was merged with Using the loop inside admin because it is an exact duplicate of that question.

migrated from Jul 4 '11 at 5:49

This question came from our site for professional and enthusiast programmers.

Browse other questions tagged or ask your own question.