Returns any and all post types you want. But I am trying to find a way to separate them. I tried to use a normal loop but I don't know how to fetch the current taxonomy tag from the page.

I have 2 questions which are all related but seeing what is the best way to go about this. Pretend I have 3 posts types ('post' 'post2' 'post3')

Is there a loop that can be used in taxonomy.php that will display a particular post type? So it can be possible to have one loop for each post type? So when I click on a taxonomy term, the taxonomy.php will return:

1 Answer
1

Probably the easiest way to do this is ignore the existing $wp_query and create three new queries in your taxonomy template. So don't start "The Loop" in your template, just create a new query and loop with that one. Repeat this for the other post types. This also means you don't need to hook into the pre_get_posts filter, you create a custom query just for you.

You will have to think about the UI for the next pages, indeed. This depends on the reason you want the post types separated. If it is enough that you see the three together on the first page, you could go with three separate "next page" links, so one per post type.