Es gibt eine neue Methode den Google +1 Button in Websites einzubauen: http://www.google.com/intl/en/webmasters/+1/button/
Für WordPress einfach als URL the_permalink(); einfügen. Der alte Code im Header verschwindet.
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="standard" href="<?php the_permalink(); ?>"></g:plusone>
<!-- Place this tag after the last plusone tag -->
<script type="text/javascript">
window.___gcfg = {lang: 'de'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
Und hier als HTML5 valider Syntax:
<!-- Place this tag where you want the +1 button to render -->
<div class="g-plusone" data-annotation="inline" data-width="120" href="<?php the_permalink(); ?>"></div>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
window.___gcfg = {lang: 'de'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
vielen dank hab schon danach gesucht :)
Danke für den Tipp! Allerdings dürfte auch diese neue Methode nicht valides (X)HTML erzeugen, denn der Tag ist kein HTML. Oder liege ich da falsch?
Ja, da hast du sicherlich Recht. g:plusone wird wohl momentan noch invalid sein.
Mittlerweile scheint es eine Möglichkeit zu geben, den +1 Button valide einzubinden:
[code]
<!-- Place this tag where you want the +1 button to render -->
<div class="g-plusone" data-annotation="inline" data-width="120" href="<?php the_permalink(); ?>"></div>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
window.___gcfg = {lang: 'de'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
[/code]
Quelle: http://www.google.com/intl/en/webmasters/+1/button/ (-> Advanced options)