Skip to content

Instantly share code, notes, and snippets.

@tacoverdo
Created March 6, 2017 13:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tacoverdo/7fc9832d651fe3d9a0852daff096350b to your computer and use it in GitHub Desktop.
Save tacoverdo/7fc9832d651fe3d9a0852daff096350b to your computer and use it in GitHub Desktop.
Replace WooCommerce breadcrumbs with Yoast breadcrumbs
<?php
// Both woo_breadcrumbs() and Yoast breadcrumbs need to be enabled in the WordPress admin for this to function.
add_filter( 'woo_breadcrumbs', 'woo_custom_use_yoast_breadcrumbs' );
function woo_custom_use_yoast_breadcrumbs( $breadcrumbs ) {
if ( function_exists( 'yoast_breadcrumb' ) ) {
$before = '<div class="breadcrumb breadcrumbs woo - breadcrumbs"><div class="breadcrumb - trail">';
$after = '</div></div>';
$breadcrumbs = yoast_breadcrumb( $before, $after, false );
}
return $breadcrumbs;
} // End woo_custom_use_yoast_breadcrumbs()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment