Wordpress Breadcrumbs

255 views Asked by At

As we only have one category for all posts, it doesn't make sense to have the category link in our breadcrumbs. So instead of:

frontpage/category_name/post_name

We would like:

frontpage/post_archive (home)/post_name

Can't find any article on how to do this properly. Can anyone help?

Thanks!

2

There are 2 answers

2
Dhaval Modi On

Please use below plugin. its good plugin.

https://wordpress.org/plugins/breadcrumb-navxt/

2
Virik On

I ended up using Yoast SEO breadcrumbs, as we're using this plugin anyways. To swap WooCommerce breadcrumbs for Yoast, use the following code:

// Replace WooCommerce breadcrumbs with Yoast bredcrumbs
remove_action('init', 'woocommerce_breadcrumb', 20, 0);
remove_action('woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0);
add_action( 'woocommerce_before_main_content','my_yoast_breadcrumb', 20, 0);
if (!function_exists('my_yoast_breadcrumb') ) {
  function my_yoast_breadcrumb() {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
  }
}