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