Support

Home Forums Event Espresso Premium EE slugs and blog (permalink) slugs

EE slugs and blog (permalink) slugs

Posted: June 26, 2018 at 4:28 am

Viewing 1 reply thread


Waz

June 26, 2018 at 4:28 am

Hi Guys

Quick question – I am wondering if the code found on this page is still compatible with current EE version
https://eventespresso.com/topic/ignore-front-base-in-permalink-structure/

add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'my_custom_cpt_rewrite', 10, 2 );
function my_custom_cpt_rewrite( $slug, $post_type ) {
    if ( $post_type == 'espresso_events' ) {
        $custom_rewrite = array( 'slug' => 'events', 'with_front' => false );
        return $custom_rewrite;
    }
}

I gave it a quick test and it appears to work but then when I try to access a page of an event I get a 404

Ideally what I would like to do is setup my website to be
website.com/blog/ for the blog
website.com/enrol/ for the slug for events

I have the slug /enrol/ already setup in templates for the events so that is fine. What I need to do, if I switch my permalinks over in WP to include the /blog/ slug is for the /blog/ to be replaced by /enrol/ for EE events only

I hope that makes sense, cheers

Waz


Tony

  • Support Staff

June 26, 2018 at 4:59 am

Hi Waz,

I gave it a quick test and it appears to work but then when I try to access a page of an event I get a 404

Did you flush your permalinks after adding the above code? Any time you make changes to permalinks you need to go to Dashboard -> Settings -> Permalinks and hit save.

Ideally what I would like to do is setup my website to be
website.com/blog/ for the blog
website.com/enrol/ for the slug for events

So you currently have your permalinks set to something like /blog/%postname%/?

Viewing 1 reply thread

The support post ‘EE slugs and blog (permalink) slugs’ 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