Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

Automatically add Google Plus (+) to your Post

Google Plus (+) is a new service from Google, which can bring traffic to your blog just like other social networking sites as such as Twitter or Facebook. Now, I’m going to show you how to automatically add a Google plus (+) button to your posts.

Well to add the Google Plus (+) button is easy just add the below piece of code in functions.php of your theme :

add_filter('the_content', 'wpr_google_plusone');
function wpr_google_plusone($content) {
	$content = $content.'<div class="plusone"><g:plusone size="tall" href="'.get_permalink().'"></g:plusone></div>';
	return $content;
}
add_action ('wp_enqueue_scripts','wpr_google_plusone_script');
function wpr_google_plusone_script() {
	wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null);
}

Viola ! you can see you Google Plus (+) button after the post

Subscribe via Email

Share this:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • WhatsApp
  • Email

Related

January 21, 2012 Ritesh Sanap WordPress FaceBook, functions.php, Google, Google Plus, Hacks, Tricks, Twitter

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation

Previous Previous post: Yet Another Related Posts Plugin ( YARPP ) shows double results
Next Next post: How to run android apps on PC – BlueStacks

Currently Trending

  • How to download Specific parts of YouTube videos
  • How to Change the Welcome/Login Screen in Windows XP ?
  • Windows Vista CD key
  • Embed Text Resizing Widget To Increase or Decrease The Font Size
  • Free Online Angry Birds game
  • Different way’s to shutdown your pc
  • Check if your Antivirus Is Working Properly
  • Free Online Virus and Malware Scan
  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • 110 Amazing Magic Tricks with Everyday Objects - eBook

Get Latest post in your Inbox

Random Posts

Tips and Tricks Hunt for the Author

June 22, 2009 By Ritesh Sanap Leave a Comment

How to display or show comment-author’s profile image in Blogger/BlogSpot blogs

March 27, 2009 By Ritesh Sanap 7 Comments

WordPress Asking for FTP details every time while upgrading

March 4, 2011 By Ritesh Sanap Leave a Comment

How to Get more Retweets

August 9, 2009 By Ritesh Sanap Leave a Comment

Facebook Like or Recommend Button For Blogger

May 24, 2010 By Ritesh Sanap 4 Comments

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2023 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean