• Resolved ptrv

    (@ptrv)


    Hi,

    I have 2 event categories.
    I am using shortcodes in templates to display the events for each event category, like
    [events_list_grouped mode="daily" category='1,-2']#_EVENTLINK[/events_list_grouped].

    When two events from two different categories have the same name and same date, there is no distinction in the url/slug. Both are like http://www.site.com/events/eventname-2014-09-01, and both link to the event in one of the two categories. So one link shows the event from the wrong event category, with the wrong content.

    Is there a way to solve this? Changing event names is not an option.
    Can I get the category slug in the url or some other unique parameter that makes the link go to the right event in the right category?

    Thanks in advance, Peter

    https://wordpress.org/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Can you share an link? Do the two events have different permalink slugs on the Edit Event page?

    Thread Starter ptrv

    (@ptrv)

    Hi,

    The slugs are the same.
    Much more categories are planned, all will have events with the same name, and all events are recurrent (weekdays) so al lot of them will be on the same date. The difference is the event category and the content.
    I can not ask the person who has to maintain the website to change the name or slug of an event to make it different for each category. With lots of categories and lots of events, it will be a real hassle and flaws will be inevitable I think.
    There must be a way to solve this?

    I have found code to get the category name in the permalink slug
    http://blog.avirtualhome.com/events-manager-better-permalinks/
    so now the links are:
    http://www.site.com/events/category1/same_eventname-2014-09-01
    http://www.site.com/events/category2/same_eventname-2014-09-01
    but it makes no difference. The link for the event in category2 still points to the event on category1. Big problem.

    The site is not public yet so I can not post a link.

    Thanks, Peter

    The slugs are the same.

    That’s the problem. By default, WordPress & Events Manager should force a unique permalink slug even if the title isn’t unique by adding -2, -3, etc. to the end of the slug.

    Do you have any plugins or custom code running that deal with permalinks or redirecting?

    Thread Starter ptrv

    (@ptrv)

    Ops..
    I do have some code in my functions.php that auto-updates the slug when someone changes a pagetitle. After removing that the problem is gone.
    Sorry to have bothered you and thank you so much for pointing it out to me!!

    Thread Starter ptrv

    (@ptrv)

    I have included the wp_unique_post_slug() function in my auto-update-slug code, and now I can keep using that code AND have unique slugs.

    Thanks again, Peter

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with events, same name and date, different category’ is closed to new replies.