Loop within a Plugin changes read/write title
-
Hi there,
I am building a plugin with which I can select a custom post type-post for a page within the write/edit screen of a page.
I do this by creating a <select> component filled the String, which I get through:
// The Query query_posts('post_type=news&order=ASC'); // The Loop $String = '<option value="0">-</option>'; while ( have_posts() ) : the_post(); if($mdg_footer == get_the_ID()){ $String .= '<option value="'. get_the_ID() .'" selected="yes">' . get_the_title() . '</option>'; }else{ $String .= '<option value="'. get_the_ID() .'">' . get_the_title() . '</option>'; } endwhile; // Reset Query wp_reset_query();
However, each time when I open the page the title of the page changes to the last item of the loop.
Resetting the loop doesn’t change anything
Does anyone know how to prevent the title from being changed?
Thanks in Advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Loop within a Plugin changes read/write title’ is closed to new replies.