Skip Navigation

[Resolved] Using post relationships in search bar

This support ticket is created 5 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
- 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)

This topic contains 6 replies, has 2 voices.

Last updated by kerimF 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1310979
content2.PNG
content1.PNG

Hi there!

So I'm trying to build a site where I advertise courses for trainers and as a place for those trainers to share their content. I want to create profile pages for the trainers, where their own events and content are displayed.

So what I tried to do is make a link between the content and the trainer using post-relationship. After that, I tried to build a custom search view that displays the content that specific trainer makes. I tried to do this by making a view that displays all the content, and use the query filter to only show the content from that specific trainer, using post relationship. However, even though I see the relationship is properly made, I still don't see the right results. On the page, I can see: "no results found". Here is a link to the page where the view is displayed: hidden link. I'll upload screenshots from the view so you can see how it's structured.

It would be great if you can tell me where I did something wrong. Thanks!

#1311043

Hi again,

I can get your website credentials from previous thread:
https://toolset.com/forums/topic/editing-search-view/

I am checking it in your website, will update here if there is any found

#1311061

Thanks a bunch bro!

#1311085

Here are what I found:
I assume we are talking about the post view "Content-trainer":
hidden link

You are using below settings:
1) query "Trainers" posts
2) filter by:
- Select posts with taxonomy:
Types set by the parent Taxonomy View
- Categorieën set by the parent Taxonomy View

Two problems
- there isn't taxonomy in that page:
hidden link
So both filters won't be able to work
- The taxonomy "Types" is not register to post type "Trainers", so the first filter won't work. see the your settings here:
hidden link
in section "Taxonomies to be used with"

I assume you are going to do this:
In a single "Trainers" post, display related "Inspiraties" posts by relationship "trainer-evenement-verbinding".
If it is, it needs just one simple post view and a relationship filter, I have setup a demo in your website:
1) Create a post view:
- Query "Inspiraties" posts,
- filter by:
Select posts in a Trainers Inspiraties verbindingen relationship that are related to the Post where this View is shown.
see it here:
hidden link

2) Create a test "Trainers" post, related it with other "Inspiraties" posts:
hidden link
put above view in post content:
[wpv-view name="content-trainer-2"]
Test it in front-end:
hidden link

I can see the related "Inspiraties" post link in front-end.

More help:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
section "Displaying many related items"

#1311137

Awesome. I got it to work! Although it doesn't show filters. I don't get this, since the Toolset shortcodes are there. Can you tell me what I'm doing wrong here?

#1311913

I assume you are going to setup custom search form in view, you can follow our document to setup the search form, see our document:
https://toolset.com/documentation/user-guides/front-page-filters/

And since the previous thread is marked as resolved:
https://toolset.com/forums/topic/editing-search-view/
So the your website credentials are removed:
This private information was removed to protect your privacy.

So I can not log into your website again.

If you need more assistance for the new issue, please open a new ticket with your website credentials, thanks

#1312043

My issue is resolved now. Thank you!