Created
April 21, 2013 05:50
-
-
Save anandkumar/5428633 to your computer and use it in GitHub Desktop.
Add Google+ comments to WordPress by modifying theme file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Google+ comments on WordPress | |
* More info: http://www.blogsynthesis.com/?p=1072 | |
***/ | |
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> | |
<div id="plusonecomments"></div> | |
<script type="text/javascript"> | |
window.setTimeout(function() { | |
var id = 'plusonecomments'; | |
var divWidth = document.getElementById(id).offsetWidth; | |
var width = !!divWidth ? Math.min(divWidth, 750) : 600; | |
var url = "<?php the_permalink(); ?>"; | |
var moderationUrl = ""; | |
var moderationMode = "FILTERED_POSTMOD"; | |
gapi.comments.render(id, { | |
'href': url, | |
'first_party_property': 'BLOGGER', | |
'legacy_comment_moderation_url': moderationUrl, | |
'view_type': moderationMode, | |
'width': width | |
}); | |
}, 10); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment