My query works fine to pull out all my posts with a value of ‘ALBUM’, but I now need to further sort those posts by a value called ‘RELEASE_YEAR’.
I am having trouble incorporating that second meta_key query in to my results.
How would I add to the below to ensure all posts are sorted by ‘RELEASE_YEAR’ field?
Any help appreciated.
<?php
$posts = get_posts(array(
'post_type' => 'discography',
'posts_per_page' => -1,
'meta_key' => 'release_category',
'meta_value' => 'album',
'orderby' => 'meta_value',
'order' => 'ASC',
));
if( $posts ): ?>
This has not been solved.