Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @mmediax ,

    I was having similar issue, and eventually figured it out, you’ll have to add this function in your functions.php file:

    add_filter( 'wpseo_breadcrumb_links', function( $links ) {
       if ( is_single('your-specific-post-slug') ) {
          $breadcrumb[0] = array(
             'text' => 'Link 1',
             'url' => site_url( '/url-to-page-Link-1/' ),
             'allow_html' => 1
           );
     
           $breadcrumb[1] = array(
              'url' => site_url( '/url-to-page-Link-2/' ),
              'text' => 'Link 2',
            );
    
            array_splice( $links, 1, -2, $breadcrumb );
        }
    
    
        return $links;
    });

    $breadcrumb is an array, so you can add as many links as you like.

    There is no need to add Home here, you’ll add it in the settings.

    And Single post will be added automatically.

    Hope this is what you’re looking for.

    • This reply was modified 2 years, 1 month ago by dia95din.

    Hey @mmediax,

    As @dia95din mentioned, you can indeed add multiple items to the array as shown in the reply.

    Just noting that we can’t give support on customization or snippets, as we don’t want to suggest incomplete code or incompatible code with your site. Hope you understand. Good luck.

    Thread Starter mmediax

    (@mmediax)

    Thank you @dia95din!

    But I want to remove “Home” link and I don′t know how to do it. If I delete text link for Home in Yoast settings the function you give me doesn′t work right.

    Thread Starter mmediax

    (@mmediax)

    Thanks Dia95din!

    It works perfectly.

    Do you know how to remove the home link from breadcrumbs path?

    I hace tried that code but something weird happens, the order of breadcrumbs links change:

    function wpseo_remove_home_breadcrumb($links) { 
    if ( $links[0]['url'] == home_url('/') ) {
     array_shift($links); } return $links; 
    } 
    add_filter('wpseo_breadcrumb_links', 
    
    'wpseo_remove_home_breadcrumb');
    • This reply was modified 2 years ago by mmediax.
    • This reply was modified 2 years ago by mmediax.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to customize full breadcrumb pathway’ is closed to new replies.