Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1370559

    We are having trouble displaying the correct breadcrumb path for WooComerce products.

    I tried various solutions:

    1. Primary category plug-in application
    https://codecanyon.net/item/woocommerce-product-primary-category-plugin/19642775?_ga=2.159255866.1608430433.1666954925-1558367430.1646238385

    However, it does not work with enfold and does not compare the display of the breadcrumbs category hierarchy. Works in other templates.

    2. Yoast SEO breadcrumbs
    This is the second solution that I tested. I found the code on the forum:

    The code works fine and so does breadcrumbs. There is a screenshot in the private message.

    However, this code does not replace or remove breadcrumbs from enfold. My goal is for yoast breadcrumbs to replace basic breadcrumbs for enfold.

    #1370728

    Hey creativeopole,
    Thank you for your patience, perhaps I can help you use the Yoast breadcrumbs and hide the Enfold breadcrumbs, in your screenshot I see the Yoast breadcrumb is above the Enfold breadcrumb container and I assume this is where you want the Yoast breadcrumbs.
    Please link to your page so I can evaluate a solution.

    Best regards,
    Mike

    #1370754

    My goal is for the Yoast breadcrumbs to display exactly in the place of the enfold breadcrumbs.

    Because the solution I found causes both breadcrumbs to display.

    #1370804

    Hi,
    Thanks for the login to your site, I added this function to replace the avia-breadcrumbs with your wpseo_breadcrumb shortcode:

    function replace_avia_breadcrumb_with_wpseo_breadcrumb() { ?>
      <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){	
          var wpseo_breadcrumb = '<?php echo do_shortcode("[wpseo_breadcrumb]"); ?>';
    	  $('.breadcrumb.breadcrumbs.avia-breadcrumbs').replaceWith('<div class="breadcrumb breadcrumbs avia-breadcrumbs">' + wpseo_breadcrumb + '</div>');
    })(jQuery);
    });
    </script>
      <?php
    }
    add_action('wp_footer', 'replace_avia_breadcrumb_with_wpseo_breadcrumb');

    Please check

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.