Tag Archives: plusone

How to add the +1 button to your site!

Today I received an email from Google webmaster central letting me know the +1 button code is now available!

You only need to add two lines of code to get the shiny new +1 button on your site.

In the head tag, or just before the end of the body tag put this line of code in:

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

Place this line of code on the page where you want the +1 button to appear:

<g:plusone href="http://modularinternetmarketing.com/"></g:plusone>

Place the site that you want to +1 in the href attribute.

In a wordpress site if you want each post to be +1′d page the code would be:

<g:plusone href="<?php the_permalink(); ?>"></g:plusone>
Size Button With Count Button Without Count
Small

 

 

Standard

 

 

Medium

 

 

Tall

 

N/A

If you want to use a size other than the standard 24px high you need to add a size attribute, which can have one of 3 values: small (15px), medium (20px) and tall (65px).

To stop the count from displaying put count=”false” into the code. Note that this doesn’t work for the tall size button.