![]() |
| Google+ Pages |
However this line of code is currently not a standard-HTML5-markup, therefore the W3-validator will return an error. After a few weeks of thinking I found a solution - which is more a quick workaround than a real solution - however it should be enough for now.
Read how to solve this problem after the break...
Link to Google+ page with your website in a HTML5-valid way:
- Create a Google+ page (if not done so far).
- First of all grab the tiny piece of code from Google+ badge config tool. Make sure you use your the right page-id (you can find it in the canonical tag on your Google+ page).
- You'll just need the first line of code, which should look like: <link href="https://plus.google.com/YOUR_PAGE_ID" rel="publisher" />
- Open your favorite HTML-editor and go to the head-tag.
- Now check for the PHP-variable $_SERVER['HTTP_USER_AGENT'] W3-validtor and tell the script to show the link-tag only if the user-agent does not contain W3C_Validator
The result should look somewhat like this:
Now go ahead, check the linking with the Google rich snippets tool and validate your code:if(substr($_SERVER['HTTP_USER_AGENT'], 0, 13) != 'W3C_Validator'){ echo '<link href="https://plus.google.com/YOUR_SITE_ID/" rel="publisher" />'; }
I hope you'll enjoy this quick fix. Let's hope the rel=publisher tag may become a valid attribute again.

0 comments:
Post a Comment