Skip Navigation

[Resolved] How to Show Grandparent Post Terms

This support ticket is created 4 years, 1 month 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by himanshuS 4 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1901821
custom filed is current user.png

I have three post types
1) Project Submisisons
2) Expert Review Request
3) Expert Match

(1) and (2) are in a O2O relationship.
(2) and (3) are in a O2O relationship.

In expert match form, I have created a custom select field that shows all users with role 'expert'. I (admin) then assign expert review requests to experts by submitting expert match form by selecting expert name from the select field.

On the expert match post, I want to taxonomy terms that are associated with the grandparent project submission.

To do this, I created three views.
View 1:
Project submissions connected by relationship loop and contains:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-taxonomy type="skill-category" separator=", " format="name" show="name" order="asc"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

View 2: Expert Review Requests connected by relationship loop
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-view name="1-Grandparent Project Submission Skill Tags"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

View 3: Expert Match to show posts where custom field is current user. (I am not sure how to add that filter but have shared a screenshot with my attempt)
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-view name="2-Parent Expert Review Request Skills Tags"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

What am I missing?

#1902001

Hello,

Please elaborate the questions with more details:

I want to taxonomy terms that are associated with the grandparent project submission.

What are the taxonomy terms we talking about?
How do you setup the custom taxonomy?

Please provide detail steps to reproduce the problem, thanks

#1903381

1) The taxonomy term is skills-category.
2) The taxonomy term is assigned to project submission post type.
3) Taxonomy terms are predefined and user can select up to 3 terms
4) when user submits a project submission, these three terms are assigned to the custom post. I want to show these 3 terms on the grandchild post.
3) Project submission post type is in a O2O relationship with expert review request.
4) expert review request is in a O2O relationship with expert match.
5) I have custom post templates creates in elementor for each post type.
6) I want to sow the project submission post type on expert match post type.
7) As the view shortcode only enables access to parent or child posts, I can't get access to grandparent posts.

I tried to creates nested views (mentioned earlier) to get the terms.
First view queries project submissions CPT with skill-category taxonomy. The filter uses the relationship post is in the loop option.
Second view queries expert review request CPT and adds the first view as shortcode. The filter again uses the relationship post is in the loop option.
Third view queries expert match CPT and adds second view as shortcode. This view should be on the post (expert match) and get the expert match post ID and use it to get terms of it's grand parent. But I do not know how to do that.

Can you help?

#1903493

Thanks for the details, in your case, it does not need nested views, it needs just two content templates, for example:
1) Create a content template "project-submission-info", display the taxonomy shortcode skills-category
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-taxonomy
2) Create another content template "expert-review-request-info", display the above content template shortcode with item attribute:

[wpv-post-body view_template="project-submission-info" item="@{relationship-slug}.parent"]

You should replace {relationship-slug} with post type relationship slug between Project Submisisons and Expert Review Request
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

3) Same as above, in the single Expert Match post, you can display content template of step 2) shortcode, like this:

[wpv-post-body view_template="expert-review-request-info" item="@{relationship-slug}.parent"]

For your reference.

#1904687

Thank you.

#1904689

My issue is resolved now. Thank you!