Skip to content

Instantly share code, notes, and snippets.

@anandkumar
Created April 21, 2013 05:50
Show Gist options
  • Save anandkumar/5428633 to your computer and use it in GitHub Desktop.
Save anandkumar/5428633 to your computer and use it in GitHub Desktop.
Add Google+ comments to WordPress by modifying theme file.
/***
* 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