Skip Navigation

[Resolved] Separate Views Loops by Taxonomy

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to show a list of taxonomy terms, and underneath each term I would like to show a list of posts associated with that term.

Solution: Use 2 nested Views. The outer View should be a View of the Taxonomy terms. In the Loop Output, insert the wpv-taxonomy-title shortcode. The inner View should be a View of posts, filtered by the taxonomy, where the term slug is set by the parent taxonomy View. Then insert the inner View in the Loop Output of the outer View just after the wpv-taxonomy-title shortcode.

Relevant Documentation:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by Marie 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#843954
Layer 1.png

Hi! I'm trying to make an archive page where each post are grouped under a taxonomy.

The taxonomy will be like a Chapter Category, so it will keep increasing as time goes by (like a webcomic) - I was wondering if it will be possible to have this done automatically?

I would like to display links grouped under taxonomy without manually adding a separate view for each taxonomy, because it would result to a lot of views and would clutter up the database. I have added an image to show what I would like to happen.

Is it possible for this to do?

Thank you!

#846665

Hi, let me be sure I understand what you're asking. It sounds like your custom taxonomy is called "Chapter Category", and the terms in this custom taxonomy are "Taxonomy A", "Taxonomy B", and so on. You would like to list all the terms, and include all the posts associated with each term in the list. Is this correct?

If so, then you can accomplish this with only two Views:
- Create a View of Posts and add a Query Filter by taxonomy term, where the term slug is set by the parent taxonomy View.
- In the Loop Output editor of this View, insert a link to the post using the wpv-post-link shortcode.
- Create a View of the Taxonomy "Chapter Category" terms
- In the Loop Output editor of this View, insert the taxonomy term title using the wpv-taxonomy-title shortcode.
- After the wpv-taxonomy-title shortcode, insert the View of Posts you created in step 1.
- Finally, insert the View of Taxonomy terms in a custom Page, or insert the View just before the wpv-loop tag in a WordPress Archive assigned to this taxonomy.

#847333
01.JPG

Hi Christian! Thank you so much for the response!
I was able to follow everything, but the view returns with a duplicate of the taxonomy and it did not show any items ("No Items Found")

View #1:
Taxonomy filter
Select posts with taxonomy: Storylines set by the parent Taxonomy View
And in between the loop, i have: [wpv-post-link]

View #2:
[wpv-post-taxonomy type="my-comic-chapter"]
[wpv-view name="comic-all-view" limit="-1" orderby="date" order="asc" cached="off"]

And then I added the View #2 to a custom page - but it only shows the thing in the screenshot.
Please let me know how to proceed, thank you!

#847934

I was able to figure it out! For the Views #1, the taxonomy filter should be set to "the same as the current post in the loop" instead of "Set by the Parent Taxonomy View" -- so far it's been working well, but I will have to continue to check.
Thank you for the help!

#847960

Please take screenshots of both View editor screens in wp-admin so I can see how the Content Selection and Query Filters are configured.

[wpv-post-taxonomy type="my-comic-chapter"]

The wpv-post-taxonomy shortcode only works in the context of a post, but View #2 should be a View of terms. In the Loop you can use the Fields & Views button to insert the taxonomy title shortcode wpv-taxonomy-title instead, or a taxonomy link shortcode.

#847961

Oh okay great, I didn't see your response before sending mine. Let me know if you need more assistance.

#850535

Thank you so much!