Just so you do not have to write to first point:
add_filter ('robots_txt','mc_add_sitemap_index');
function mc_add_sitemap_index($robots) {
$robots .= "Sitemap: " .
home_url( '/sitemap_index.xml' );
return $robots;
}
and solution for breacrumb:
add_filter ('wpseo_breadcrumb_output','mc_microdata_breadcrumb');
function mc_microdata_breadcrumb ($link_output) {
$link_output = preg_replace(array('#<span xmlns:v="http://rdf.data-vocabulary.org/\#">#','#<span typeof="v:Breadcrumb"><a href="(.*?)" .*?'.'>(.*?)</a></span>#','#<span typeof="v:Breadcrumb">(.*?)</span>#','# property=".*?"#','#</span>$#'), array('','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="$1" itemprop="url"><span itemprop="title">$2</span></a></span>','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">$1</span></span>','',''), $link_output);
return $link_output;
}
and about the problem with social opengraph – you should add
<html version=”HTML+RDFa 1.0″>
so
add_filter ('language_attributes','mc_language_attributes');
function mc_language_attributes ($output) {
$output .= ' version="HTML+RDFa 1.0"';
return $output;
}
it will probably still not validate with W3C validator as this is still experimental function, but it is valid (e.g. http://dhuny.com/188)
but it is questionable if this should be done, many people will probably dislike the another error notice in w3c validator
Hey thomask, this is great that you’ve looked into this. Does the breadcrumb fix validate with the w3c validator?
Also, where would you insert the breadcrumb filter code?
Did you add it to a specific file from the plugin or your theme itself?
Thanks in advance,
– Andrew
yes, it will validate (see e.g. http://validator.w3.org/check?verbose=1&uri=http://www.money.cz/money-s3/vlastnosti-systemu/) and google recognise it as breadcrumb
you can insert it functions.php or plugin, it is up to you. I yould not put it to theme files, as you would have to put it to every theme file
Hmmm… it actually causes more errors than the 3 pre-existing ones (5 now). The issue is the itemtype, itemprop and itemscope not being recognized attributes. I haven’t checked your facebook fix but the breadcrumbs update you listed maybe needs a little more tweaks.
– Andrew
no, it is perfectly validate, as you can see on the validator link. Of course there may be other problems on your site – typicaly what is the html version of the page?? give here a link and i may look at it
I’ve added your code in the class constructor function of wordpress-seo/frontend/class-breadcrumbs.php. Below is the link to the validation for the page. Let me know your thoughts.
See the Results
– Andrew
1. ehm. do not edit others plugins as it will make them not-updatable
2. you are using XHTML 1.0 Transitional, actualy i do not know if it is possible to use microformats wΓth xhtml and what you have to do for it. I am using HTML5, where it perfectly validates. Try to google the errors with xhtml 1.0 transitional, sorry for not helping more.
Hey No worries thomask. Thanks for looking into it.
Hopefully we can all find a solution to these little quirks.
Take Care,
– Andrew
Wow, thanks a lot Thomas, breadcrumb validation now works like a breeze π
So, how to validate with XHTML 1.0?
A little months ago there isn’t this problem with seo yoast breadcrumbs.
A response for XHTML 1.0 validation problem would be appreciated. π
Also breadcrumbs has XHTML 1.0 validation problem.