This Code Byte provides a very simple & cheeky/lazy way of creating filters to query certain post types/fields and sort them.
Within WordPress admin you can of course filter your content by clicking on a field like so:
You will then notice your url changes to:
Although this is a
PHP GET request, it’s actually usable within your theme to set up specific queries, like sorting by a certain field, or post/page type.
This example will query posts and sort them by their
<?php query_posts( 'orderby=title&order=asc' ); ?>
Of course, this is very simple, but sometimes a little easier than trying to remember or find out the field name you want to sort by.