Support

Home Forums Event Espresso Premium Changed slug, but breadcrumbs still says "Events"

Changed slug, but breadcrumbs still says "Events"

Posted: October 14, 2017 at 10:35 am


soi

October 14, 2017 at 10:35 am

Hi,

We changed the slug /events to /classes. Although the URL is correct, the breadcrumb still says /events. We are using Yoast to implement breadcrumbs. Is there another place we need to update so that it reflects in breadcrumbs? Thanks!


Josh

  • Support Staff

October 14, 2017 at 1:23 pm

Hi there,

I’m afraid the Yoast SEO plugin doesn’t use Event Espresso’s settings when it assembles the breadcrumbs. The Yoast SEO plugin does include some filter hooks so you can change the breadcrumb output via a filter function. Here’s an example:

add_filter('wpseo_breadcrumb_single_link' ,'wpseo_breadcrumbs_change_events', 10 ,2);
function wpseo_breadcrumbs_change_events($link_output, $link ){

    if( $link['text'] == 'Events' ) {
        $link['text'] = 'Classes';
        $link_output = '<span rel="v:child" typeof="v:Breadcrumb">';
        $link_output .= '<a href="' . $link['url'] . '" ';
        $link_output .= 'rel="v:url" property="v:title">';
        $link_output .= $link['text'];
        $link_output .= '</a>';
    }

    return $link_output;
}

You can add the above to a functions plugin or into your WordPress theme’s functions.php file and it will change the output from Events to Classes.


soi

October 15, 2017 at 6:49 am

Like a charm, thanks!

The support post ‘Changed slug, but breadcrumbs still says "Events"’ 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