A Google Plus badge is a feature rich way of converting visitors over to your Google Plus personal profile, page, or community. The badge will permit logged in users to add you to a circle directly from your website. The Google Page badge will make your website eligible for Google+ Direct Connect (enabling a feature in Search that'll permit a user to add you to a circle).
Note: Google+ is now deprecated. The post remains as a reference only.
While Google have a tool to manufacture the necessary code, shortcode gives the option of very easily effecting changes globally. It also provides your authors with a more uniform way of adding the feature.
This article will provide you with the necessary code to add either a Google Badge onto your WordPress website with shortcode.
The badge we use for BeliefMedia (a page we've never posted to) is rendered with the shortcode of
[googleplusbadge landscape="1" id="101664805814849068242" type="page"]. The result:
[googleplusbadge landscape="1" id="101664805814849068242" type="page"]
The shortcode of
[googleplusbadge id="101343022544296051888"] will display my personal profile in the (default) portrait mode.
The same profile in landscape looks like this:
[googleplusbadge id="101343022544296051888" landscape="1"]
Note that while a page profile badge presents the +1 option, the personal profile badge does not.
[googleplusbadge id="112861932260007740384" width="273" theme="dark" type="page"]
Not very pretty! You may omit the tagline with the shortcode of
You may include a community badge with the shortcode of
[googleplusbadge landscape="1" id="115758385206378551362" type="community"]. The result:
[googleplusbadge landscape="1" id="https://plus.google.com/communities/115758385206378551362" type="community"]
Note that the page type attribute of
community must be defined if the badge is not for a personal or brand profile.
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin.
There's a large number of attributes but they should be considered 'options'. Set your default values so your preferred badge can be rendered with just
idis the ID or URL for your personal profile, page, or community.
community. It must be defined.
dark. It is light be default.
taglinein portrait mode can be removed with
photo="0"(not very reliable in our tests).
landscape="1"for landscape mode. Defaults to portrait.
p="1". If you choose not to use them, use
Used outside of WordPress, the following may be used. The
platform.js code is required.
Attributes should be passed to the function in the arguments array.
No longer available.