Skip Navigation

[Resolved] Complex nested views based on different taxonomies

This support ticket is created 3 years, 11 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by romanB-3 3 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1602567

Hello,
I have posts with 2 different taxonomies : "Auteurs" and "Thématiques".
On the "Auteurs" Term Archive page, I need a section to display the "Auteurs with most common Thématiques with current Auteur".
Meaning the section will display 2 other "Auteurs" terms, based on the greatest number of posts that have same "Thématiques" terms of the current "Auteur"'s posts.
I wonder if I can make this with builtin Toolset and nested Views, of if it's better to build this with a shortcode ?
Thank you.

#1603603

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Meaning the section will display 2 other "Auteurs" terms, based on the greatest number of posts that have same "Thématiques" terms of the current "Auteur"'s posts.
==>
I do not understand your above requirement. Can you please share test example using which I can understand your issue and based on that example I will be able to guide you in the right direction.

#1603869

In my setting, "Authors" are a custom taxonomy.
And every post also have terms from another taxonomy "Thematic".
So each post is published by one or several Authors, and is about one or several Thematics.
On the page of every "Author", I need to display a section called "Other Authors you may be interested in."

Here is how I was thinking to do it, but I'm not sure if it's a good idea to do this with Views or if it would be more efficient with a custom function :
1- On Author Term Archive Page, get all posts from Author;
2- On those posts, get all terms from "Thematic" taxonomy;
3- Among all posts in database, get posts with those "Thematic" terms;
4- Into those posts, count posts for each Author and get the 2 Authors with most posts.

Does it make any sens now ?
Thank you.

#1603925

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1- On Author Term Archive Page, get all posts from Author;
2- On those posts, get all terms from "Thematic" taxonomy;
3- Among all posts in database, get posts with those "Thematic" terms:
4- Into those posts, count posts for each Author and get the 2 Authors with most posts.
====>
Based on the information you shared it does not look like you can achieve this easily by using only nested views.

You will be able to get all posts once you loop through all the posts.

How you collect the terms belongs to Thematic as view can display the results you can not collect/stroe information to variables.

You can only display it with each loop iteration. For example, there is 25 posts, it will loop through the 25 posts belongs to the author term, you can not store the terms assigned for Thematic taxonomy anywhere.

You need to write a custom query to achieve this.

#1604065

I understand the problem and will try to find another solution with custom queries thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.