2012-03-22 13 views
0

私は3つのgoogle +1ボタンを同じwordpressページに持っています。しかし、exclamation markを表示してクリックしたときにそのうちの1つが失敗します。 +1 button is unavailable or has stopped working.私が説明した考えられる理由のいずれも発生しないことをかなり確信している:クリックが再び次のページが開かれた+1ボタンが利用できない、または動作しなくなった

enter image description here

両方のコードは実質的に同じである:

// float code (malfunction) 
<div id="float_plusone"> 
<g:plusone size="tall" href="<?php echo urlencode(get_permalink()); ?>" count="true"></g:plusone> 
</div> 
<script type="text/javascript"> 
(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> 

// above/below posts code (works) 
<script type="text/javascript"> 
(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> 
<g:plusone size="medium" callback="googleplus_click"></g:plusone> 

について任意の提案は大歓迎です。

答えて

2

これは、ボタンがサーバーに送信して+1するURLです。

"id":"http://bestpushchairs.net/qc21/disclosure-policy/http%3A%2F%2Fbestpushchairs.net%2Fqc21%2Fdisclosure-policy%2F" 

ボタンがhref値を取り、それが現在のパスに相対的であると仮定しているように見えます。 urlencodeを使用しないでください。

+0

+1私は 'href =" <?php echo urlencode(get_permalink());?> "'を完全に削除しました。今働いている。ありがとう! –

関連する問題