How to Add Google+ comments in WordPress without using any Plugin?
- Login into your WordPress Admin area.You can reach there by entering your credential at http://yourblog.com/wp-admin.The screenshot of the login form is shown below:
- Navigate to Appearance>>Editor in your Dashboard. The screenshot of the same is shown below:
- It will open the Theme Editor Window. Click on “Comment.php” file on the right hand side. The screenshot of the same is shown below:
- In comment.php file, Try to look for “<div id=”comments”>“. The screenshot of the same is shown below:
- Paste the Below given codes just below “<div id=”comments”>” in your comment.php file.
<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
- If you are finding it difficult to understand, see the below given screenshot:
- Once done, click on the “Update File” button. The screenshot for the same is shown below:
- That’s it. You are done. Google+ comments will be added just above your Default WordPress Comment form so enjoy.
0 comments: Post Yours! Read Comment Policy ▼
PLEASE NOTE:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.
Post a Comment