Last active
July 8, 2017 19:29
-
-
Save Willem-Siebe/6f43704e8536fc308fc3 to your computer and use it in GitHub Desktop.
Remove Shop page from WordPress SEO (Yoast) WooCommerce breadcrumb on is_product page, see http://wpquestions.com/question/showChrono/id/8603.
This file contains 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
// Remove Shop page from WooCommerce breadcrumb on is_product page, see https://gist.github.com/Willem-Siebe/6f43704e8536fc308fc3. | |
function wsis_wpseo_breadcrumb_output( $output ){ | |
if( is_product() ){ | |
$from = ' » <span typeof="v:Breadcrumb"><a href="http://yoururl.com/shop/" rel="v:url" property="v:title">Producten</a></span>'; | |
$to = ''; | |
$output = str_replace( $from, $to, $output ); | |
} | |
return $output; | |
} | |
add_filter( 'wpseo_breadcrumb_output', 'wsis_wpseo_breadcrumb_output' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try replacing
http://yoururl.com
With'.site_url().'
. This will work on any domain if you are running a staging site for example.