wp query order by category code example
Example 1: wordpress query orderby name
query_posts( array(
'post_type' => 'page',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
) );
Example 2: wp_query order by taxonomy
$timeline_taxonomies = get_terms(array(
'fields' => 'ids', //get the IDs
'taxonomy' => 'taxonomy_name',
'orderby' => 'term_order',
'hide_empty' => true,
));