I'm trying to use WP_Query to create a list of posts, where the list is sorted first by category, then in alphabetical order. I also want the category title to show up above the first post of that category. This would basically create a list of posts similar to:
CATEGORY ONE TITLE
Post A
Post B
Post C
CATEGORY TWO TITLE
Post D
Post E
Post F
CATEGORY THREE TITLE
Post A
Post B
Post C
And so on. I can get the posts to sort themselves by category using:
$second_query = new WP_Query( 'post_type=page&posts_per_page=-1&orderby=meta_value&meta_key=Category&order=asc&post_parent='.$parent );
while ($second_query->have_posts()) : $second_query->the_post();
?>
CODE TO DISPLAY POST
<?php
endwhile;
wp_reset_postdata();
but can't figure out how to then sub-sort those results alphabetically (they seem to sort themselves by date), or display the category title above the first post of that category.
Can anyone help me out with this? :)