Home › Forums › Calendar Products › Events Calendar PRO › Related Events: How to change the filter?
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by
Benjamin White.
-
AuthorPosts
-
August 12, 2017 at 2:19 am #1334373
Benjamin White
ParticipantWith the related events – is there a way to change how it filters related events? For example – I have 2 events, listed with different categories, but at the same venue.
Now under related events, they are showing up on their events pages (am I making sense?!) – I assume because they’re at the same venue?
How do I change it so under related events, it only displays events with the same category and ignores the venue information?
August 14, 2017 at 6:00 am #1334895Nico
MemberHi there Benjamin,
Thanks for getting in touch with us! Let me help you out 🙂
How do I change it so under related events, it only displays events with the same category and ignores the venue information?
Related events are picked up by tags and event categories, no relation is done by venue information. Can you re-check this in your site?
Also, if you want to customize the parameters for this query you might find this two filters useful: ‘tribe_related_posts_args’. And if you want to modify the result, you can use ‘tribe_get_related_posts’.
Please let me know if the above helps,
Best,
NicoAugust 14, 2017 at 7:16 am #1334948Benjamin White
ParticipantHi Nico, thanks for the reply –
Related events are picked up by tags and event categories, no relation is done by venue information. Can you re-check this in your site?
I must be relating events via the tag field then – apologies. But the goal is still to only relate events via the Category and ignore everything else.
Also, if you want to customize the parameters for this query you might find this two filters useful: ‘tribe_related_posts_args’. And if you want to modify the result, you can use ‘tribe_get_related_posts’.
Could you point me in the right direction on how to edit these filters? Which file will I find them in – related-events.php?
Thanks!
August 14, 2017 at 11:08 am #1335057Nico
MemberThanks for following up Benjamin 🙂
Could you point me in the right direction on how to edit these filters? Which file will I find them in – related-events.php?
Sure, just paste the code below in your child theme’s functions.php file:
https://gist.github.com/niconerd/da39fdc6d097d5f5f1486d8566f89039
Please let me know if that works for you,
Best,
NicoPD: please note we are not always able to provide help on customizations, this case is fairly simple thou.
August 15, 2017 at 2:40 am #1335343Benjamin White
ParticipantPerfect, thanks Nico that’s got it.
Thanks so much for the support – top notch.
August 15, 2017 at 6:52 am #1335419Nico
MemberAwesome! Stoked to hear this worked for you 🙂
I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘Related Events: How to change the filter?’ is closed to new replies.
