Hi!
I have a custom type 'shops' which has a custom type 'promotions' related. I would like that when I click on the 'promotions' button it will direct me to a page with only the promotions of that shops. I've done the promotions view but it shows me all the promotions, not just the ones that are linked to the parent custom type. Could you help me?
Hello, when you create a View of the Promotions post type, you can add a Query Filter (https://toolset.com/course-lesson/creating-a-view/#filter-the-list-of-posts) that filters by Post Relationship. You can set up that filter to respond to a URL parameter (see url-param.png). Then in the Shop post template, insert a link to the page containing the View of Promotions and include the current Shop post ID in the link as using the desired URL parameter. You can use this custom HTML as an example for creating such a link with the URL parameter wpv-related-to, as shown in my attachment:
<a href="<em><u>hidden link</u></em> item='$current_page']">Promotions for this Shop</a>
Change the URL to match the URL of the page containing the View of Promotions. When someone clicks the link on the Shop page, they will be redirected to the page containing the Promotions View, with the correct URL parameter and value automatically applied.