WordPressにGoogle+シェア(共有)ボタン設置する方法です。
Google+のシェアボタンの設置の方法です。
設置の為のソースは、
https://developers.google.com/+/plugins/share/?hl=ja
こちらから手に入れてください。
詳細設定を押すとサイトのリンクを設定する項目と、非同期で読み込む方法がでてきます。
パーマリンクの設定の部分は、<?php the_permalink(); ?>
を入れれば良いだけなので、このサイトの場合は、
[php]
<!– 共有ボタン を表示したい位置に次のタグを貼り付けてください。 –>
<div class=”g-plus” data-action=”share” data-annotation=”vertical-bubble” data-height=”60″ data-href=”<?php the_permalink(); ?>”></div>
<!– 最後の 共有 タグの後に次のタグを貼り付けてください。 –>
<script type=”text/javascript”>
window.___gcfg = {lang: ‘ja’, parsetags: ‘onload’};
(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>
[/php]