Leave one category out of list view and "next/previous event"? +WPML

Home Forums Calendar Products Events Calendar PRO Leave one category out of list view and "next/previous event"? +WPML

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21297
    Torstein
    Participant

    I am using the events calendar pro together with WPML, and have mostly gotten things working by using

    $locale = get_locale();
    if ($locale == nb_NO) { (...and so on...)

    to get different queries (the norwegian version of the category in one query, and the english version in the other). Mostly this works fine, but there are a few places there are some problems:

    Is it possible to leave one or more categories out of the “next/previous events”-links (tribe_previous_event_link) on the bottom of the single events template?

    I have tried using “hide from list of upcoming events”, but the still shows up in the “next/previous”-links on single events :/

    Also, the same thing happens with the norwegian/english versions of the events: when I’m on one of “norwegian” events, I get one link to the same event in english (of course, since it is at the same time, just a different language/category), and one to the event before, also in english.

    The ideal solution would probably be if I could modify tribe_previous_event_link() and tribe_next_event_link() to only show next/previous-links “within” the current category, then the norwegian/english-issues would be solved, and links to rehearsals and other “private” events would only show up if you were already viewing one.

    Could someone give me a hand with this?

    #21313
    Joyce Grace
    Member

    Hi Torstein,
    Thanks for posting here. This sounds like some pretty heavy duty customization work. We don’t normally support this level of customization on this forum. All I could do is direct you to the Themer’s Guide to customizing the Events Calendar: https://theeventscalendar.com/themers-guide-to-the-events-calendar/

    The other option would be to hire a developer to do this for you, or, you might find a kind soul to help you out on the WordPress.org forums, or even here, if a community member reads this.

    I will see if one of our higher level support people can do anything for you, in case this is a simple fix he knows how to do already, but no guarantees, sorry!

    #21328
    Torstein
    Participant

    I’ve tried looking at the themers guide and the documentation, but cant find anything there. Would appreciate if you could check with the higher level support people if they have any ideas 🙂

    #21350
    Jonah
    Participant

    Hi Torstein,

    Your best bet to be able to exclude categories from the prev/next post links is this plugin: http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

    Please try that and let us know if you need anything else.

    Regards,
    Jonah

    #21510
    Torstein
    Participant

    Thanks Jonah! Ill try that and report back 🙂

    #21776
    Rob
    Member

    How’d this go, Torstein? Let us know if you need anything else on this end or if we can close the thread out. Thanks!

    #23423
    Torstein
    Participant

    Hey, sorry for late updates! It works – nearly. I just noticed that the ordering is wrong – that the wrong events are shown as “next/previous” some places. Most of the events were posted in the correct order, so the problem didn’t appear until an event was posted later, with an event date “inbetween” the events posted earlier.

    But, it should be quite simple to solve, since the “nextprevious post link plus”-plugin Jonah linked to supports ordering by a custom field and meta_value, so the only thing that bugs me – this feels a bit dumb, but I really can’t figure the name of the date field, to use as “meta_key”?

    #23424
    Torstein
    Participant

    Hmmm… might this be correct?
    ‘meta_key’ => ‘_EventStartDate’

    #23448
    Rob
    Member

    Hey Torstein. It could be; I’m not sure myself, and Jonah is out on sabbatical the next few weeks…but I’ve asked Casey from our community team to take a look and confirm re: your last point best he can. Stay tuned here!

    #23497
    Casey
    Participant

    Torstein,
    Try doing something like this when you call the plugin’s template tag:

    ‘order_by’ => ‘_EventStartDate’

    Let me know if that does the trick or not. Thanks!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Leave one category out of list view and "next/previous event"? +WPML’ is closed to new replies.