Related Events: How to change the filter?

Home Forums Calendar Products Events Calendar PRO Related Events: How to change the filter?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1334373
    Benjamin White
    Participant

    With 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?

    #1334895
    Nico
    Member

    Hi 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,
    Nico

    #1334948
    Benjamin White
    Participant

    Hi 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!

    #1335057
    Nico
    Member

    Thanks 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,
    Nico

    PD: please note we are not always able to provide help on customizations, this case is fairly simple thou.

    #1335343
    Benjamin White
    Participant

    Perfect, thanks Nico that’s got it.

    Thanks so much for the support – top notch.

    #1335419
    Nico
    Member

    Awesome! 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Related Events: How to change the filter?’ is closed to new replies.