Plugin Directory

Share Buttons by Lockerz / AddToAny

Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google, StumbleUpon, LinkedIn and many mor

Where are the options?

In your Admin panel, go to Settings > AddToAny. Among other options, you can choose which button, individual icons and advanced sharing buttons (Facebook Like Button, Twitter Tweet Button, Google+ Share Button, Google +1 Button) to display, and where and how to display them.

To place the buttons as a "widget" in your theme (if your theme supports WordPress Widgets), go to Appearance > Widgets, then drag AddToAny to an available Widget Area and click Save.

Why isn't the drop-down menu appearing?

It's likely because your theme wasn't coded properly. With many themes you can use the Theme Editor to edit your theme's header.php and footer.php files.

In header.php place the following line of code just before the </head> line:

<?php wp_head(); ?>

In footer.php place the following line of code just before the </body> line:

<?php wp_footer(); ?>

How can I add both the button and the individual icons to another area of my theme?

In the Theme Editor, place this code block where you want the button and individual icons to appear in your theme:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>

If you want to customize the shared URL and title for the button and standalone services, use the following code as a template:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { 
    ADDTOANY_SHARE_SAVE_KIT( array("linkname" => "Example Page", "linkurl" => "http://example.com/page.html") );
} ?>

If you want to share the current URL and title (detected on the client-side), use the following code:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { 
    ADDTOANY_SHARE_SAVE_KIT( array("use_current_page" => TRUE) );
} ?>

If you want to hardcode the shared current URL and modify the title (server-side), use the following code as a template:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { 
    ADDTOANY_SHARE_SAVE_KIT( array("linkname" => (is_home() ? get_bloginfo('description') : wp_title('', FALSE)), "linkurl" => (is_ssl() ? 'https://' : 'http://') . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']) );
} ?>

How can I add just the button to another area of my theme?

In the Theme Editor, you will place this line of code where you want the button to appear in your theme:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) { ADDTOANY_SHARE_SAVE_BUTTON(); } ?>

If you want to customize the shared URL and title for this button, use the following code as a template:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) { 
    ADDTOANY_SHARE_SAVE_BUTTON( array("linkname" => "Example Page", "linkurl" => "http://example.com/page.html") );
} ?>

How can I add just the individual icons to another area of my theme?

In the Theme Editor, place this line of code where you want the individual icons to appear in your theme (within an HTML list):

<?php echo '<div class="a2a_kit addtoany_list">';
if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) { ADDTOANY_SHARE_SAVE_ICONS(); }
echo '</div>'; ?>

If you want to customize the shared URL and title for these icons, use the following code as a template:

<?php
if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) {
    echo '<div class="a2a_kit addtoany_list">';
    ADDTOANY_SHARE_SAVE_ICONS( array(
        "linkname" => "Example Page", "linkurl" => "http://example.com/page.html"
    ));
    echo '</div>';
} ?>

Or you can place the icons as individual links without styling:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) { ADDTOANY_SHARE_SAVE_ICONS(); } ?>

If you want to customize the shared URL and title for these icons, use the following code as a template:

<?php if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) {
    ADDTOANY_SHARE_SAVE_ICONS( array("linkname" => "Example Page", "linkurl" => "http://example.com/page.html") );
} ?>

How can I add a new custom standalone service?

You can create a plugin or customize the following PHP sample code to add to your theme's function.php file:

function addtoany_add_services( $services ) {
  $services['google_example'] = array(
    'name' => 'Google Example',
    'icon_url' => 'http://www.google.com/favicon.ico',
    'icon_width' => 16,
    'icon_height' => 16,
    'href' => 'http://www.example.com/add?linkurl=A2A_LINKURL&linkname=A2A_LINKNAME'
  );
  return $services;
}
add_filter('A2A_SHARE_SAVE_services', 'addtoany_add_services', 10, 1);

How can I align the button and/or icons to the center or to the right side of posts?

It depends on your theme, but you can try adding the following CSS code to your main stylesheet.

To align right:

.addtoany_share_save_container { text-align:right; }

To align center:

.addtoany_share_save_container { text-align:center; }

How can I remove a button from individual posts and pages?

Insert the following tag into the page or post (HTML tab) that you do not want the button to appear in: <!--nosharesave-->

How can I force the button to appear in individual posts and pages?

If your button isn't already set up to appear (it is by default), insert the following tag into the page or post (HTML tab) that you want the button to appear in: <!--sharesave-->

Why doesn't Facebook use the page title and how can I set the image Facebook uses?

Facebook does link sharing a little differently than most other services. Facebook expects the Title, Description, and Thumbnail of a shared page to be defined in the actual HTML code of a shared page. Unlike other services, Facebook does not accept the values you have set for your sharing widget. To change the title, description or image on Facebook, you will need to modify your theme.

Try running Facebook's URL Debugger on your pages to see how Facebook is reading your site.

To change the title, description and/or image on Facebook, you will need to modify your theme's header file according to Facebook's specification. With WordPress, this can be accomplished with plugins like the All in One SEO Pack plugin. Please see that plugin for details, and post in the WordPress or plugin author's forums for more support.

For more technical information on setting your pages up for Facebook sharing, see "Step 2 - Get Open Graph Tags" in Facebook's documentation.

Why does the Facebook Like Button, Twitter Tweet Button, Google+ Share Button, or Google +1 Button have so much whitespace to the right of it?

The minimum width for the Facebook Like Button is 90 pixels. This is required to display the total number of Likes to the right of the button. See Facebook's Like Button documentation for details

It's not recommended, but you can change the width of the Facebook Like Button using CSS code, for instance: .a2a_button_facebook_like { width:50px !important; }

The Twitter Tweet Button with 'total count' enabled is 130 pixels. You can change the width using CSS code, for instance: .a2a_button_twitter_tweet { width:100px !important; }

The Google +1 Button with 'total count' enabled is 90 pixels. You can change the width using CSS code, for instance: .a2a_button_google_plusone { width:65px !important; }

The Google+ Share Button width can be changed using CSS code, for instance: .a2a_button_google_plus_share { width:57px !important; }

Does the plugin output W3C valid code?

Yes, this plugin outputs 100% W3C valid XHTML & HTML5 and W3C valid CSS 3.0 by default.

If you use the Facebook Like, Twitter Tweet or Google +1 buttons in an HTML5 theme, note that the button iframes use the scrolling attribute, which is valid XHTML but the attribute has been deprecated in HTML5. It's needed to prevent scrollbars from appearing over the Like, Tweet, and +1 buttons inside of the iframes.

If you move the plugin's CSS code to your theme's stylesheet, note that one proprietary vendor prefix (filter) is used. It's utilized for cross-browser compatibility with Internet Explorer. For more information about the W3C CSS Validator and the filter property, see Why don't [sic] my scrollbar properties, filters, etc. validate? If you feel compelled, you can move the line into an Internet Explorer-only stylesheet, or remove the line at the cost of the opacity hover effect in Internet Explorer.

Regardless of circumstances for passing W3C tests, the plugin will always output semantically valid and robot-readable code, so publishers do not have to worry about search engine crawler errors due to invalid code. Both web standards and cross-browser are taken very seriously.

Is there a shortcode for sharing?

Yes, you can place your sharing buttons exactly where you want them by inserting the following shortcode in a post or page:

[addtoany]

You can also customize the shared URL like so:

[addtoany url="http://www.example.com/page.html" title="Some Example Page"]

How can I move the plugin's inline CSS into my theme's main external stylesheet?

Go to Settings > AddToAny > uncheck Use inline CSS and place the CSS code in your theme's main stylesheet.

Why does the menu appear behind embedded objects (like Flash)?

Please read this document for an explanation and possible fix. For WordPress, an easier fix is to have the plugin hide intersecting embedded objects. Just copy & paste the recommended code into the Additional Options box in Settings > AddToAny, then save changes.

For a WordPress Multisite Network (MS), how can I set the plugin as a "Must-Use" plugin to automatically execute for all blogs?

Upload the plugin directory (including all files and directories within) to the /wp-content/mu-plugins/ folder, then move the add-to-any.php file from the plugin directory to the mu-plugins folder so that it can auto-execute.

Requires: 2.8 or higher
Compatible up to: 3.4.2
Last Updated: 2012-4-24
Downloads: 2,434,558

Ratings

4 stars
4.1 out of 5 stars

Support

0 of 13 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

5 people say it works.
3 people say it's broken.

100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,4,4 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,12,12 100,4,4 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,3,3 100,1,1
89,9,8 100,4,4 100,3,3 100,1,1 100,1,1 100,3,3 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 0,1,0 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
50,2,1 100,4,4 100,9,9 67,3,2 91,11,10 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 0,1,0 100,3,3 100,1,1 100,1,1
100,5,5 100,21,21 91,34,31 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
97,37,36 100,16,16 82,11,9 100,10,10 83,12,10 100,24,24 100,3,3 0,1,0 100,2,2 100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
80,10,8 100,7,7 67,3,2 80,5,4 81,43,35 100,3,3 100,2,2 100,8,8 67,3,2 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 50,2,1 50,2,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,8,8 92,24,22 94,17,16 95,19,18 100,4,4 100,1,1 91,11,10 100,5,5 78,9,7 95,20,19 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,10,10 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,3,3 100,4,4 100,1,1 75,8,6 100,4,4 100,1,1 100,1,1
100,1,1 100,1,1 67,3,2 100,1,1 100,6,6 100,4,4 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 80,15,12 100,1,1 100,1,1 100,1,1 100,2,2 75,4,3 50,2,1 71,7,5 67,9,6 100,9,9 92,12,11 100,12,12 100,3,3 100,2,2 100,2,2 100,2,2 100,2,2 100,1,1 100,1,1
86,7,6 100,2,2 100,4,4 100,2,2 100,1,1 100,2,2 100,1,1 100,2,2 100,2,2 100,1,1 100,1,1
75,4,3 100,5,5 90,10,9 100,1,1 100,3,3 100,2,2 100,1,1 100,1,1 100,1,1
100,4,4 67,6,4 91,11,10 88,8,7 100,3,3 100,1,1
83,6,5 100,2,2
100,1,1 70,10,7 100,2,2 0,1,0
75,12,9 96,24,23 100,14,14
100,8,8 100,1,1
86,7,6 92,12,11 100,6,6 100,6,6 100,7,7 33,3,1 100,2,2 100,3,3 100,1,1
100,3,3 81,16,13 100,1,1
64,11,7
92,13,12
87,15,13
75,4,3
63,8,5