Woocommerce Breadcrumbs X-Theme

I am using X-Theme for my WooCommerce Store Theme. I need to figure out how to create breadcrumbs for all pages. This includes the home > category > sub-category > product. The current breadcrumbs only include shop > product.

Is there a recommended plugin or code?

Hello There,

Thanks for writing in! Several users were using Yoast Breadcrumb. They have successfully integrated it in X theme. You can download and install from here: https://yoast.com/wordpress/plugins/breadcrumbs/

Before you can use it in X theme, because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

After the child theme is set up, please add the following code in your child theme’s functions.php file

if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {

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

  }
endif;

Please let us know how it goes.

I have added the code to the php in the child theme but still not changing, I notice that they dont disapear when I untick them on the custumizer too

Hi,

I tried that code in my test site and it seems to work.

Would you mind providing us your wordpress admin login in Secure Note os we can take a closer look.

Hi @wicara,

Could you try removing the header.php template from your child theme? Then please provide your FTP login credentials as well. I like to do some testing but doing that in admin may trigger issues (file editing).

Thanks!

Thanks for the tip!
I improved a little bit on the code, in order to keep the style of the theme:

//  Use Yoast breadcrumbs instead of X
if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {
    if ( x_get_option( 'x_breadcrumb_display', 1 ) && function_exists('yoast_breadcrumb') ) {
      yoast_breadcrumb('<div id="breadcrumbs" class="x-breadcrumbs">','</div>');
    } else {
      echo '<p>Please install Yoast Breadcrumb plugin.</p>';
    }
  }
endif;

and in the Yoast settings, put this as the separator text:

<i class="x-icon-angle-right" data-x-icon-s=""></i>

and this as the Home text:

<i class="x-icon-home" data-x-icon-s=""></i>

You’re more than welcome, glad we could help.

Cheers!