How To Add Google +1 Button To WordPress Without Plugins

Today I’ll share a small tip on how to add Google +1 button to WordPress without any plugin. Google recently launched Google plus one button (Google +1 button) for social recommendation.

How to add Google +1 button to WordPress without any plugin:

Go to your header.php and immediately before

</head>

, place the following code:

<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>

Then you need to place the Google plus one button where you want to place in your theme. Normally it’s single.php file if you need to place it at your single posts. Place the following code there where you want to place the +1 button – before or after the post. Here is the code below:

<g:plusone href="<?php the_permalink(); ?>"></g:plusone>

Google +1 button has the following options:

size="small"  - To display small size +1 button of 15px
size="medium" - To display medium size +1 button of 20px
size="large" - To display large size +1 button of 60px

So you may customize the Google +1 button code for single.php this way:

<g:plusone size="tall" href="<?php the_permalink(); ?>"></g:plusone>

If you want to check Google +1 button resources, you can find here.

Users who found this post were searching for:

google banrerjie, wordpress google plus without plugin, wordpress templates for best cpu usage

Related posts:

  1. 5 Best WordPress Forum Plugins for Easy WordPress Forum Installation
  2. Best WordPress Code Highlighter Plugin: Syntax Highlighter Evolved
  3. Google Page Speed & WordPress SEO
  4. How To Redirect Attachment Page To Post Page – WordPress Tips
  5. How to add custom backgrounds (image/color/border) to Thesis WordPress theme
About Debajyoti

Debajyoti Banerjee is the Founder and CEO of Seven Boats Info-System Pvt. Ltd. - A full service digital marketing company in India. Debajyoti is an experienced SEO expert and Internet Marketing consultant from Kolkata, India. As a web entrepreneur and online marketing strategist, he is helping many companies to transform their businesses to the next level of success by 1) making their websites convenient, interactive and immediate; 2) helping them to reduce cost and increase efficiency; 3) making their websites more flexible and 4) helping them to get more global customers.

Speak Your Mind

*

CommentLuv badge