Support

Home Forums Event Espresso Premium 404Error when change "venues" in URL slug

404Error when change "venues" in URL slug

Posted: January 11, 2017 at 9:02 am

Viewing 2 reply threads


Karli

January 11, 2017 at 9:02 am

Hi,

I tried your code posted on https://eventespresso.com/version/ee4/page/10/ (under How to change the “venues” CPT slug) on my child theme functions.php file.

Here’s my slightly revised code:

add_filter( ‘FHEE__EE_Register_CPTs__register_CPT__rewrite’, ‘my_custom_venue_slug’, 10, 2 );
function my_custom_venue_slug( $slug, $post_type ) {
if ( $post_type == ‘espresso_venues’ ) {
$custom_slug = array( ‘slug’ => ‘schools’ );
return $custom_slug;
}
return $slug;
}

The filter worked in that it did change the post-type from venues to schools in the URL, but now I’m getting a 404 error for all my venue (school) pages.

If I manually change the URL from “schools” to “venues”, I’m able to see the page again.

Any ideas how to finish this?

Thank you!


Josh

  • Support Staff

January 11, 2017 at 9:13 am

Hi Karli,

After making that code change, you’ll need to browse to the WP > Settings > Permalinks page. Simply loading that page will refresh the rewrite rules for your site.


Karli

January 11, 2017 at 12:16 pm

Thank you. It’s working now.

Viewing 2 reply threads

The support post ‘404Error when change "venues" in URL slug’ 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