0
votes

This is question on the seo yoast wordporess plugin.

I have a friend who doesn't know that much about code/wordpress/etc, they have an ecommerce site built using magento and a blog using wordpress which is styled to match the main site and they use yoast seo plugin for seo etc. They have asked me to try an get the breadcrumbs working for them in a different way to what i know, from what i can see they want to add a prefix to the breadcrumbs 'home' which links to main site then renaming the blog from home to blog, for example home(main site) > blog(blog) > post. Now i did just that in the plugin settings but they said that the schema markup wouldn't be complete and said there’s a filter hook called ‘wpseo_breadcrumb_links’ which gives access to the array of URLs and anchor text used to build the breadcrumbs, now i cant find anything on google that explains this or how to start writing it, i do know that it needs to go in the functions file.

Would it be possible to get some help on this.

Thanks in advance and very much appreciated.

Justin

2

2 Answers

0
votes

I'm not sure what Schema.org markup has to do with breadcrumbs! :) Schema is used on post/page level. So, they are either oversmarting themselves or I got you wrong.

0
votes

I think this sample code may be helpful:

add_filter( 'wpseo_breadcrumb_output', 'custom_wpseo_breadcrumb_output' );

function custom_wpseo_breadcrumb_output( $output ){
if( is_product() ){
$from = '<span typeof="v:Breadcrumb"><a href="http://pbs.transparentwebdesigns.co.uk/products/" rel="v:url" property="v:title">Products</a></span> &raquo;'; 
$to = '';
$output = str_replace( $from, $to, $output );
}
return $output;
}

It looks like wpseo_breadcrumb_output gives you access to the entire output instead of just the link portion. Please see this page for more details: http://wpquestions.com/question/showChrono/id/8603