WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
How to remove Products link - Shop (1 post)

  1. jumust
    Member
    Posted 10 months ago #

    Hi,
    I'd like to remove the parent link "Products" (linked to shop page) in the breadcrumbs of product pages.

    Now I have "Home-->Products-->Product Category-->Product name

    I have tried this snippet in my functions.php file

    add_filter( 'wpseo_breadcrumb_links', 'custom_wpseo_breadcrumb_links' );
    
    function custom_wpseo_breadcrumb_links( $links ){
        if( is_product() ){
           // print_r( $links );
            unset( $links[1] );  // unset the second array item (starts from 0, 1, 2, ... )
        }
     return $links;
    }

    It worked, basically the Products link disappeared. But I don't know why now the Product Category link is not linked anymore. In the source code I see it got class="breadcrumb_last".

    How can I fix it?

    Thanks

    http://wordpress.org/plugins/wordpress-seo/

Reply

You must log in to post.

About this Plugin

About this Topic