Related Events Just Showing Next Scheduled Events Rather Than Related Ones

Home Forums Calendar Products Events Calendar PRO Related Events Just Showing Next Scheduled Events Rather Than Related Ones

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #147975
    adamfuller
    Participant

    My related events section on single event listings is simply showing the next 3 events rather than the next 3 related events. Hence, it shows the same 3 events on every single event listing until one of them passes, at which point the next scheduled event is selected.

    I can tell it’s working to some extent because if on event A the related events are B,C, and D, when I visit event B the related events become A, C, and D.

    I’m no expert by any stretch (literally no idea wtf I’m doing) but I’ve had a look at tribe_get_related_posts() and it seems to be using categories and tags to attempt to find related events, correct?

    I think this maybe the source of the problem in that the significant majority of my events are grouped under the same parent category. I have a parent category “Event Type” which is populated with 5 or 6 child categories. There is another separate parent category “Genre” which is populated with 20+ genres. This means that (I think) every event falls under “Event Type” even though they are all different types (i.e. “Type 1”, “Type 2”).

    So my thinking is that the function above sees that all the events are in the same parent category and can’t distinguish anything between them in order to generate sensible related events. Note: On events categorised as “Event Type –> Type 1” or “Event Type –> Type 2”, only “Type 1” and “Type 2” are selected, not the parent category “Event Type”.

    I don’t have an explanation as to why the tags part isn’t working, as there all the events are individually tagged well and there is plenty of healthy overlap on the tags. Enough, I should think, to generate sensible related events.

    Any thoughts?

    Really it would make most sense (for my specific case, at least) if events could be classed as related if they’re at the same venue or listed by the same organiser.

    #150376
    Barry
    Member

    Hmm, interesting.

    After taking a look at your site it certainly seems to be behaving as it should here … that said, it’s not necessarily the case that that will produce ideal results for every site. It sounds to me like you’ve got a pretty good handle on what’s happening and we’d be more than open to any feature requests you might post about changing/extending the logic used to determine what exactly counts as a related event and the degree to which the result set needs to be “randomized”, etc.

    If you are fairly at home with PHP and WordPress development in general – I know you suggested you are not, but it might be you have a developer at your disposal or are happy to dive in and give it a shot – it’s worth considering that you can use the tribe_get_related_posts filter hook to put your own logic in place here.

    I hope that helps πŸ™‚

    #150804
    adamfuller
    Participant

    Hi Barry,

    Thanks for the response. Sounds reasonable. I’ll have a play around but I don’t think I’m competent enough to use the filter hook and get it working myself, hah. But if I do succeed I’ll share my code and maybe it’ll find its way to an implemented feature request eh?

    Could you just clarify one thing for me? Wondering if my assumptions are correct about the categories thing? i.e. the function isn’t differentiating between cat->subcat1 and cat->subcat2. I’m not quite sure how the parent categories thing works really.

    Cheers

    #151656
    Barry
    Member

    Definitely feel free to share and even submit a pull request if you get that far πŸ™‚ … even if it isn’t something that the team feels is suitable for inclusion in the core plugin it could definitely be handy for other users out there to see an alternative implementation.

    Could you just clarify one thing for me? Wondering if my assumptions are correct about the categories thing? i.e. the function isn’t differentiating between cat->subcat1 and cat->subcat2. I’m not quite sure how the parent categories thing works really.

    What basically happens is a simple taxonomy query is used based on the categories the source event is already assigned to. Resting on WP defaults as it does, this means child categories will be included – but it doesn’t look back up the tree of categories, if that makes sense, and I’m not sure it would always make sense for it to do so.

    Does that answer your question here/am I misunderstanding at all?

    #153651
    adamfuller
    Participant

    Thanks for your help.

    I’ve discovered that simply removing all the logic relating to categories actually goes some way to producing a solution for me.

    I’m gonna have a play around when I have time and see what better solutions I can come up with. I’ll probably also submit a feature request … makes sense to me if the “relatedness” of the events was also defined by venue/organisation among other things and, as you say, some randomisation could be useful.

    #154152
    Barry
    Member

    Sure thing – and definitely don’t feel you need to code up a solution before posting on UserVoice (though if you want to and are playing with this stuff anyway that’s great) – but let us know either way, we’re always keen to hear about how things can be improved πŸ™‚

    I’ll go ahead and close this thread but of course if we can help with any other issues please don’t hesitate to post new threads as needed.

    Thanks again!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Related Events Just Showing Next Scheduled Events Rather Than Related Ones’ is closed to new replies.