Skip Navigation

[Resolved] Custom Post Type Relationship

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
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 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1236596

I have Video and Influencer custom post type. These 2 post type share the same taxonomy 'video-cats. My objective is to display a video gallery that tagged the influencer (as they share the same category) as well. Also, listing videos (based on category in influencer's page)

I want to achieve something like this:
hidden link
hidden link

Here's the link to my site: hidden link

#1236674

My objective is to display a video gallery that tagged the influencer (as they share the same category) as well.
Okay if I understand correctly, you want to create a video gallery tagged with each Influencer, like this:
Influencer 1
- Video 1
- Video 2
- Video 3

Influencer 2
- Video 4
- Video 5
- Video 6

...etc...

Then you also want to show a list of videos on the single Influencer post, filtered by taxonomy, based on the terms applied to the single Influencer.

Am I understanding correctly? If so, then here's how I would set up the video gallery.

- For each Influencer post, create a term in the video cats taxonomy that matches the Influencer post slug. For example, if the Influencer post has a slug "john-doe", then create a term in the video cats taxonomy "john-doe". This is important because it makes the taxonomy term names consistent.
- Create a View of Influencers. In the Loop, insert the post title.
- Create a View of Videos. Add a Video Cats taxonomy Query Filter, set by a shortcode attribute like wpv-video-cat. In the Loop editor, insert the post title for now. You can come back and customize this later.
- Place the View of Videos inside the Loop of the View of Influencers. In the wpv-video-cat shortcode attribute, place the slug of the current Influencer post like this:

[wpv-view name="Your View of Videos" wpv-video-cat="[wpv-post-slug]"]

This passes the slug of the Influencer post into the video cat filter. This is why we made the Influencer slug and the taxonomy slug identical.

Then in the single Influencer post, you want to insert a list of Videos that have the same taxonomy terms as the current Influencer post.
- Create a new View of Videos
- Add a Video Cats taxonomy Query Filter, set by the post/page where this View is shown.
- In the Loop editor, output the information you want to display about each Video.

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