i am trying to query a list in a specific post type order but it doesn’t work.
$args = array(
'post_type' => array('a','b', 'c', 'd', 'e'),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => ''.$term_list.''
),
),
'orderby' => 'type'
);
what’s wrong? it works great with ‘rand’ and other query string but ‘type’ doesn’t seems to be enough!
thanks!
The only way I’ve got this working was to filter pre_get_posts. I haven’t dug into core to really see what gets set, but the filter does work.
It sounds like it’s a single view of a custom post type. You could do something like this:
This would go in your functions.php file. You will have to get the data via functions.php for the $term_list variable. In your single.php file you can place the default loop.