How To get_posts in WordPress with Multiple meta_query Values

Author: , October 13th, 2020

The first query gets all custom publication posts that have a value in field book_seq ordered by book_seq The second query gets all custom publication posts that have no meta value for book_seq or no meta record for key book_seq ordered by post_title.

Great article here: https://rudrastyh.com/wordpress/meta_query.html

How To Dual-Sort Query Results In WordPress Using get_posts

Author: , September 12th, 2019

Needed to build a feature for a Bookstore tool to have an optional sequence number for the Custom Post Type “books” that would allow items with a seq number to float to the top of the list and be sorted by seq #. The rest of the books would show underneath, sorted alphabetically.