Support

Home Forums Event Espresso Premium EE4 Permalink Settings

EE4 Permalink Settings

Posted: December 27, 2014 at 11:55 am


Chris Wathen

December 27, 2014 at 11:55 am

Good Afternoon,

I currently have my permalink settings for my blog posts set to /about/news/%postname%/, however it also affects the events. I am also renaming the slug for the events using:

//* Change Espresso slug
add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'my_custom_event_slug', 10, 2 );
    function my_custom_event_slug( $slug, $post_type ) {
    	if ( $post_type == 'espresso_events' ) {
    		$custom_slug = array( 'slug' => 'training/courses' );
    		return $custom_slug;
    	}
    	return $slug;
    }

add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'my_custom_ticket_selector_template_location');

Is there a way to have the events not follow the permalink settings from above? Currently an event link is shown as http://www.test.com/about/news/training/courses/eventname/ and it should be http://www.test.com/training/courses/eventname/


Dean

December 29, 2014 at 1:41 am

Hi,

Add in an extra parameter to the custom_slug array:

‘with_front’ => false

More info http://codex.wordpress.org/Function_Reference/register_post_type#Arguments

Don’t forget to flush your permalinks after adding this.

The support post ‘EE4 Permalink Settings’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso