In WordPress the post slug is saved in database with name post_name
, so to sort posts by slug just use: orderby=name
.
Edit:
Here’s the example of query:
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 10,
'orderby' => 'name'
);
$query = new WP_Query( $args );