How to group by taxonomy term
This is the situation:
I’ve got a custom post type called Disc.
This Post Type has 1 taxonomy called Genre.
This taxonomy has 2 terms: Rock and Pop.
Rock has got a sub-term called Hard Rock.
I want to show into archive page (or taxonomy page) a list of disc “grouped” by term. I don’t want to put manually the name of taxonomy or term into tpl. It should be dinamic. So, for example:
ACDC Album blabla
IRON MAIDEN Album blabla
AVRIL LAVIGNE Album blabla
MILEY CYRUS Album blabla
And I want to show both the title and the album. The ONLY way i found to do it is using a complex JOIN query. But I don’t want to do this practise anymore. I would like to do this using CORE WordPress functionalities. Is it possible? In Drupal I should have done this using views and “grouped by taxonomy” option. Is there this “equivalent”? Thanks in advance to all
- The topic ‘How to group by taxonomy term’ is closed to new replies.