I found this code on here that pulls all wordpress pages and displays them in a dropdown list. My question is what needs to be changed to have these pages listed alphabetically?
You have to add parameters
'orderby' => 'title',
'order' => 'ASC', // or DESC
Please find updated code.
.
query( array(
'post_type' => 'page',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC', // or DESC
));
foreach ($all_wp_pages as $value){
$post = get_page($value);
$title = $post->post_title;
$id = $post->ID;
// For example
//
echo '';
}; ?>