By default, the URL slug for a Series is simply series, e.g. your site.com/series/series-name
. This snippet allows you to change the global slug to match your needs. For example, a theater might want to change the slug to play so that they can show all the times (events) for a particular play on the Series page with a URL like example.com/play/my-fair-lady
.
The snippet
Simply place the following snippet in your theme’s functions.php file and replace new-series-slug
with whatever you’d like the slug to be.
add_filter( 'tribe_events_register_series_type_args',
function ( $args ) {
$args['rewrite'] = isset( $args['rewrite'] ) ? $args['rewrite'] : [];
$args['rewrite']['slug'] = 'new-series-slug';
return $args;
}
);
After applying the PHP snippet, it’s crucial to flush your WordPress permalinks to avoid potential navigation issues.
You can do this by going to your WordPress dashboard (wp-admin) > Settings > Permalinks, and clicking the ‘Save Changes’ button. This action flushes the permalinks, ensuring it’ll be reinterpreted and that your changes are being applied.