Multiple custom post type loops for a single custom taxonomy term archive
-
Hello.
Apologies in advance for my newness and general php ignorance, as well as the length of this post!
I’m currently designing an animation wiki site which is structured around multiple custom post types (cartoon, cartoon character, person, studio, resource) and multiple custom taxonomies. Some of these taxonomies, such as the “genre” taxonomy, apply to only one post type, and I’ve been able to design the loop for these taxonomy archives with only a bit of struggle.
Currently, I want to design archive pages for a couple of taxonomies (“country” and “series”) that are attached to posts from multiple custom post types. Rather than having one massive list of all posts from all post types for a particular term, I was hoping to separate archive pages for each term into sections based on their custom post type. Each of these sections I was hoping could call upon a different sidebar – I have several sidebars already in play for the various types of archives, such as sidebar-people.php and sidebar-cartoons.php.
Here is what I would like the “series” page for “Looney Tunes” to look like:
-
Looney Tunes (title, h1, generated from the term name)
Cartoons from the Looney Tunes series (title, h1, generated with the term name)
– Sidebar for cartoon navigation
– Various posts from the “cartoons” post typeCartoon characters from the Looney Tunes series (title, h1, generated with the term name)
– Sidebar for cartoon character navigation
– Various posts from the “cartoon characters” post typePeople associated with the Looney Tunes series (title, h1, generated with the term name)
– Sidebar for people navigation
– Various posts from the “person” post typeStudios associated with the Looney Tunes series (title, h1, generated with the term name)
– Sidebar for “studios” navigation
– Applicable entries from the “studios” post type.So far my efforts to design a multiple query loop for these archive pages have been frustrated by my lack of php skill. Here is the code I have been using for the single post-type taxonomy of “genre”: https://pastebin.com/YT9UPvyT
If you are curious, the page looks like this: https://rarebit.org/?genre=musical
Any suggestions for how I might introduce multiple loops according to post type and keep my formatting consistent (keep the columns I’ve been using) would be immensely appreciated!!!
Thanks for reading, and thanks in advance for any help.
- The topic ‘Multiple custom post type loops for a single custom taxonomy term archive’ is closed to new replies.