I have a custom post type called "artist" with a custom meta field for artists last name. I would like the archive page to display the artists alphabetically by last name.
This is what I have now:
<?php $args = array( 'post_type' => 'artist', 'orderby' => 'meta_value', 'meta_key' => 'artist_meta_artist_last_name', 'order' => 'ASC', 'posts_per_page' => -1 ); $category_posts = new WP_Query($args); if($category_posts->have_posts()) : while($category_posts->have_posts()) : $category_posts->the_post(); ?>
If I change it from ASC to DSSC it changes the order, but I'm not sure what its ordering by. Certainly not the meta_key and not by date or title. I have looked everywhere for a solution, but none have worked.