I searched the net, I asked chatgpt…. Nothing! Everything does not work…
​
I want to display my posts of the post type “book”. The books have a taxonomy called “series”. The “series” has the field “name”. And each post has a volume number.
​
I would like to display them sorted as follows:
SERIES A (taxonomy -> name)
\- Volume 1 (volume number)
\- Volume 2
… Volume x
SERIES B
\- Volume 1
… Volume x
​
I can plot and sort a single series, but I can’t get the args to sort all the post books that way.
​
So far I am filtering my posts like this – it works.
$args = array(
‘post\_type’ => ‘book’,
‘tax\_query’ => array(
array(
‘taxonomy’ => ‘book\_series’,
‘field’ => ‘name’,
‘terms’ => $book\_series,
),
),
// it will be sorted by BAND-NR 1 … x
‘meta\_key’ => ‘book\_band’,
‘orderby’ => ‘meta\_value\_num’,
‘order’ => ‘ASC’,
);
​
But I don’t want to filter, I want to list quasi all books as described above. Anyone have any idea what the args for $query = new WP\_Query($args); might look like?
Am grateful for any help.
[ad_2]