Created
March 6, 2017 13:29
-
-
Save tacoverdo/7fc9832d651fe3d9a0852daff096350b to your computer and use it in GitHub Desktop.
Replace WooCommerce breadcrumbs with Yoast breadcrumbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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