How do I add Yoast breadcrumbs to product pages in Pro?

Hey guys,

Question is in the title. I’ve tried enabling Yoast breadcrumbs and pasting the code from here in my child theme’s functions.php but no breadcrumbs show up.

I want the structure for a product on my site like this to show up with the breadcrumb structure of:
Home > Category > Product

Why won’t any breadcrumbs show?

My site is https://straighttothepoolroom.com.au

Hi,

the code will not work if you are using PRO Header.

You can try this code instead,

function add_my_breadcrumbs() {   
    if (function_exists('yoast_breadcrumb')  &&  x_is_product()) {
          yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } else {
         echo '<p>Please install Yoast Breadcrumb plugin.</p>';
    }

}
add_action( 'x_after_view_global__slider-below', 'add_my_breadcrumbs', 10 );

Please note that this falls outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer.

Thanks for understanding

Thanks Paul :slight_smile:

You’re welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.