Would you like to update the default slug for the Sugar Calendar event post type? Sugar Calendar provides a PHP constant you can add to your site’s theme files for this purpose.
This tutorial will show you the constant to update event post-type slug in Sugar Calendar.
Heads up! This guide contains PHP code and is intended for developers. We offer this code as a courtesy but don’t provide support for code customizations or 3rd party development.
Before getting starting, make sure Sugar Calendar is installed and activated on your site.
Using the SC_EVENTS_SLUG Constant
By default, the slug of the sc_events
post type is /events/
, resulting in URLs that look like this: http://example.com/events/event-name
.
With the PHP constant below, you can change this slug to any name you like.
define( 'SC_EVENTS_SLUG', 'my-events-slug' );
You’ll need to add the code snippet above to your site’s functions.php file to change the slug of this post type. Be sure to replace my-events-slug with the name you’d like to use.
Note: Check out WPBeginner’s tutorial if you need help adding custom code snippets in WordPress.
After adding the snippet, return to your site’s admin area and go to Settings » Permalinks. Then click the Save Changes button to update your site with the new slug.
That’s it! You now know how to update the event slug URL in Sugar Calendar.
Next, would you like to display events on your site’s frontend? Our tutorial on displaying event calendars covers all the steps in detail.