Breadcrumbs error - updating to X theme v10

Hello,

we would like to proceed on topic


as the topic is closed, but not solved yet.

The issue is the breadcrumbs code.
It was custom code provided by X-theme in the past, but gives an error when updating the theme now.

This code was outcommented by you when you tested the theme update. ( see closed topic )
Without the breadcrumb code, updating works fine.

However we do need a breadcrumb function.
Can you provide us with new breadcrumb code, that won’t give the error when updating the theme ?

Hello,

There’s a couple of ways we can go about this judging by the code posted in that thread.

If you are looking to rewrite and maybe slim down the child theme. I don’t think there are any docs on them, but I can write an example or two on them.

x_breadcrumbs_args filter to change arguments to then be passed to the breadcrumb data generated
x_breadcrumbs_data Filter to change items generated by breadcrumbs

We are also trying to get Breadcrumbs to be loopable in 6.4 so potentially you could handle all this in Cornerstone.

This is the list of deprecated functions that are removed in X10. I think if you just added these back in. They are simple enough. I’m not sure if you are missing anything else after this though. Let me know of any fatal errors you are getting and I can look through Pro4-5 again. If that works we can add these back in again to the main release.

  // Deprecated Functions
  // --------------------
  // Kept for legacy purposes. If a user happens to have x_breadcrumbs()
  // overwritten in a child theme from an older release that was using these
  // functions, then a fatal error could occur if they do not exist. Going
  // forward, if updates need to be made to breadcrumbs, we suggest looking
  // into the various $args and filters available for x_breadcrumbs_data() and
  // x_breadcrumbs_items(), which should give you all of the control you need
  // without having to overwrite the function directly.

  if ( ! function_exists( 'x_get_breadcrumb_delimiter' ) ) :
    function x_get_breadcrumb_delimiter() {
      $is_ltr = ! is_rtl();
      return ' <span class="delimiter"><i class="x-icon-angle-' . ( ( $is_ltr ) ? 'right' : 'left' ) . '" data-x-icon-s="&#x' . ( ( $is_ltr ) ? 'f105' : 'f104' ) . ';"></i></span> ';
    }
  endif;

  if ( ! function_exists( 'x_get_breadcrumb_home_text' ) ) :
    function x_get_breadcrumb_home_text() {
      return '<span class="home"><i class="x-icon-home" data-x-icon-s="&#xf015;"></i></span>';
    }
  endif;

  if ( ! function_exists( 'x_get_breadcrumb_current_before' ) ) :
    function x_get_breadcrumb_current_before() {
      return '<span class="current">';
    }
  endif;

  if ( ! function_exists( 'x_get_breadcrumb_current_after' ) ) :
    function x_get_breadcrumb_current_after() {
      return '</span>';
    }
  endif;

What we want to do is 2 things, both on the single product page :

  1. Insert the top level category in product breacrumbs, example Shop > Toplevel category > Product name
  2. add a back to prev page button
    which we did by using this piece of code within the x_breadcrumbs()
if ( x_is_product() ) {

       if ( $v = get_breadcrumb_category('product_cat') ) {
         $product_category = $delimiter . $v;
       } else {
         $product_category = '';
       }

        if ( $is_ltr ) {
          echo $shop_link . $product_category . $delimiter . $current_before . $page_title . $current_after;
		  echo "<div class='cat-prod-link-back' style='float:right;'><a href='#' onClick='history.go(-1); return false;'>← Terug naar de vorige pagina</a></div>";
        } else {
          echo $current_before . $page_title . $current_after . $product_category . $delimiter . $shop_link;
        }

Hey @pixar24,

I see you have a One subscription. We provide One support through the One interface. Please check the instruction to use your One plan here: https://theme.co/docs/how-to-use-your-one-plan

Submit a ticket in our One chat box and post a link to this thread for reference.

See you there.

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