I would like to order a list of post title alphabetically. I am using this specific query
// WP_Query arguments
$args = array(
'category_name' => 'reportage',
'order' => 'ASC',
'orderby' => 'title',
);
// The Query
$query = new WP_Query($args);
// The Loop
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
echo '<ul><li style="float:left; width:100%;"><a href="'.get_the_permalink().'" style="color:#D34D3D">'.get_the_title().'</a></li></ul>';
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
The query worked perfect until a certain point of the list where the order seems to be messed up.
Why the order doesn't work correctly for all the post title?