Relative URL to Events in Menu
-
I am currently setting up and testing The Events Calendar before moving it to our live site, so I want to set everything up with relative URLs that will work in both the test and live sites.
I have the Events slug set to ‘events’, so I can set normal links in WordPress to ‘events/’ and the URL is handled correctly, but I am having a difficulty setting up a menu to Events.
By default the Custom Link URL is an absolute URL – for my test site, this is “http://localhost:8888/Nancy/events/” – which won’t work when transferred to the live site.
If I delete the WordPress URL (“http://localhost:8888/Nancy”) the menu URL becomes “/events/” that attempts to link to “http://localhost:8888/events/” from the generated page – clearly not wanted.
If I change the menu URL to “events/” (or “events”), as I do elsewhere, that becomes “http://events/” (or “http://events”) in the HTML on the generated page – which is even worse. (It is actually changed to this in the Save Menu action of the Menus setup.)Does anyone know of a way to get a relative address set for Events in a Menu?
Many thanks.
-
Hi @pfitchett,
You’ll want to have your Events Slug without a “/” in order for it to work properly. You can read more about setting up your event slugs here:
https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/
Also, here is more information about adding your calendar to a menu:
https://theeventscalendar.com/knowledgebase/adding-a-calendar-link-to-your-site-menu/I hope this helps!
Thanks for your reply, Jaime; but as I said in my message, when I use the Events slug (events) without any ‘/’ in the Menu Structure Custom Link, and then Save the menu, the URL is changed to http://events.
When you are elsewhere in WordPress, the Events slug without any ‘/’ works fine, but not so in the Menu Structure.
The topic ‘Relative URL to Events in Menu’ is closed to new replies.