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
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.