WordPress.org

日本語

プラグインディレクトリ

Share Buttons by AddToAny

Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.

Where are the options, and how can I customize the sharing plugin?

In your Admin panel, go to Settings > AddToAny. Among other options, you can choose individual sharing icons, a universal share button, and official 3rd party sharing buttons (Facebook Like Button, Twitter Tweet Button, Pinterest Pin It 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.

To further customize AddToAny, see the WordPress sharing documentation for the AddToAny plugin. Many customizations will have you copy & paste one or more lines of JavaScript code into "Additional Options" box. The Additional Options box is in Settings > AddToAny.

Something is wrong. What should I try first?

Try temporarily switching themes and deactivating other plugins to identify a potential conflict. If you find a conflict, try contacting that theme or plugin author. If an issue persists on a default theme with all other plugins deactivatd, perform a google search across the WordPress forums using a query such as: site:wordpress.org/support -reviews addtoany [your issue issue here]

Feel free to post here, where the community can hopefully help you. Describe the issue, what troubleshooting you have already done, provide a link to your site, and any other potentially relevant information.

The share buttons are not displaying for me. Why, and what should I try?

Something on your own device/browser/connection is likely filtering out major social buttons.

Try another web browser, device, and/or Internet connection to see if the buttons appear. Tools like browserling.com or browserstack.com will give you an idea of what other people are seeing. The usual cause for this uncommon issue is 3rd party browser add-on software that blocks ads and optionally filters out major social buttons. Some security apps and Internet connections have an option to filter social buttons. Usually a social filter option is disabled by default, but if you find that some software is inappropriately filtering AddToAny buttons, let AddToAny know.

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"]

For Facebook sharing, how can I set the thumbnail image and description Facebook uses?

Facebook does link sharing 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 that accept common parameters, Facebook only accepts a URL, then Facebook scans the actual page for details. To change the title, description or image on Facebook, you will need to modify your theme or use another plugin that filters your theme.

Try running Facebook's URL Debugger on your pages to see how Facebook reads your site. "Fetch new scrape information" to test site changes and clear Facebook's cache of a page.

To change the title, description and/or image on Facebook, your theme's header file should be modified according to Facebook's OpenGraph specification. With WordPress, this can be accomplished with plugins such as the WordPress SEO by Yoast or the All in One SEO Pack. Please see those plugins 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 "Facebook Sharing Checklist" in Facebook's documentation.

Why do share links route through AddToAny?

Since 2006, AddToAny is trusted across the web to always route to each service's current endpoint. This routing enables publisher customization, visitor personalization, and keeps the AddToAny plugin remarkably lightweight without the need for constant plugin updates. In AddToAny menus, visitors see the services they actually use. On mobile, AddToAny presents the choice of sharing to a service's native app or mobile site and the preference is used on the next share. Publishers take advantage of AddToAny services such as email templates, Twitter templates, URL shortener & parameters, and more. Just as service icons change, service endpoints change too, and AddToAny is updated daily to reflect service endpoint and API changes.

How can I use custom icons?

Upload sharing icons in a single directory to a public location, and make sure the icon filenames match the icon filenames packaged in the AddToAny plugin. In your Admin panel, go to Settings > AddToAny > Advanced Options > check the "Use custom icons" checkbox and specify the URL to your custom icons directory (including the trailing /). For AddToAny's universal button, go to Universal Button, select Image URL and specify the exact location of your AddToAny universal share icon (including the filename).

How can I place the share buttons in a specific area of my site?

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, 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 a custom standalone share button?

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

function addtoany_add_services( $services ) {
    $services['example_share_service'] = array(
        'name'        => 'Example Share Service',
        'icon_url'    => 'https://www.google.com/favicon.ico',
        'icon_width'  => 32,
        'icon_height' => 32,
        'href'        => 'https://www.example.com/share?url=A2A_LINKURL&title=A2A_LINKNAME'
    );
    return $services;
}
add_filter( 'A2A_SHARE_SAVE_services', 'addtoany_add_services', 10, 1 );

How can I add a custom follow button?

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

function addtoany_add_follow_services( $services ) {
    $services['example_follow_service'] = array(
        'name'        => 'Example Follow Service',
        'icon_url'    => 'https://www.google.com/favicon.ico',
        'icon_width'  => 32,
        'icon_height' => 32,
        'href'        => 'https://www.example.com/ID'
    );
    return $services;
}
add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );

How can I align the sharing button(s) 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 the button(s) from individual posts and pages?

When editing a post or page, uncheck "Show sharing buttons", which is located at the bottom of the editor page. Be sure to update or publish to save your changes.

An older method was to insert the following tag into the page or post (HTML tab) that you do not want the button(s) to appear in: <!--nosharesave-->

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

When editing a post or page, check the "Show sharing buttons" checkbox, which is located at the bottom of the editor page. Be sure to update or publish to save your changes. Note that, by default, AddToAny is setup to display on all posts and pages.

An older method was to insert the following tag into the page or post (HTML tab) that you want the button(s) to appear in: <!--sharesave-->

How can I remove the button(s) from category pages, or tag/author/date/search pages?

Go to Settings > AddToAny > uncheck Display at the top or bottom of posts on archive pages. Archive pages include Category, Tag, Author, Date, and also Search pages.

How can I programmatically remove the button(s)?

In your theme's functions.php, you can add a filter to disable AddToAny sharing.

Disable AddToAny sharing in specific categories, for example:

function addtoany_disable_sharing_in_some_categories() {
    // Examples of in_category usage: https://codex.wordpress.org/Function_Reference/in_category
    if ( in_category( array( 'my_category_1_slug', 'my_category_2_slug' ) ) ) {
        return true;
    }
}
add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_in_some_categories' );

Disable AddToAny sharing on a custom post type, for example:

function addtoany_disable_sharing_on_my_custom_post_type() {
    if ( 'my_custom_post_type' == get_post_type() ) {
        return true;
    }
}
add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_on_my_custom_post_type' );

How can I position a vertical floating share buttons bar relative to content?

In settings, disable the default placement of the Vertical Buttons. In your theme's file(s), find the parent element that you want to position the vertical bar to (the parent element should have a specified width), then add the following example PHP code as a child of that parent element:

<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_FLOATING' ) ) {
    ADDTOANY_SHARE_SAVE_FLOATING( array(
        'kit_style' => 'margin-left:-100px; top:150px;',
        'vertical_type' => true,
    ) );
} ?>

Why does the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It 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 'show count' enabled is 130 pixels. You can change the width using CSS code, for instance: .a2a_button_twitter_tweet { width:100px !important; }

The Pinterest Pin It Button with 'show count' enabled is 76 pixels. You can change the width using CSS code, for instance: .a2a_button_pinterest_pin { width:90px !important; }

The Google +1 Button with 'show 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 HTML5 & XHTML and W3C valid CSS 3 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.

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 compatibility are taken seriously.

How can I load the buttons after content insertion with AJAX and infinite scroll?

Fire the standard post-load event to have the plugin initiate AddToAny buttons:

jQuery( 'body' ).trigger( 'post-load' );

A few prerequisites:

  • The request has an HTTP_X_REQUESTED_WITH header set to xmlhttprequest
  • jQuery available
  • AddToAny script blocks in the response need to execute, so don't use jQuery's load method with a selector expression. Selector expression usage with that method will cause script blocks in the response to be stripped out

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.

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.

要件: 2.8 以降
最新の対応バージョン: 4.3.1
最終更新: 2015-9-21
有効化済みインストール: 200,000+

評価

4.7 (5点満点中)

サポート

58 of 78 support threads in the last two months have been resolved.

ご意見・ご質問がおありですか ?

互換性

+
=
充分なデータがありません

4人が動作すると言っています。
0人が壊れていると言っています。

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
67,9,6
100,1,1 100,2,2 100,4,4 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 50,2,1 100,2,2 100,2,2 100,4,4 100,1,1 100,1,1 100,2,2 100,2,2
100,2,2 100,3,3 67,3,2 100,4,4 100,2,2 100,3,3 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2
100,1,1 100,3,3 100,2,2 100,2,2 100,2,2 100,1,1 100,2,2 100,2,2 100,2,2
100,1,1 67,3,2 100,3,3 100,5,5 100,3,3 100,3,3 100,2,2 100,2,2 100,1,1 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,1,1 100,1,1 100,2,2
100,3,3 88,8,7 100,4,4 100,2,2 100,3,3 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,2,2 100,1,1 100,2,2 100,1,1
100,3,3 80,5,4 100,3,3 100,2,2 100,4,4 100,2,2 100,2,2 67,3,2 100,2,2 100,3,3 100,3,3 100,2,2 100,2,2 100,1,1 100,2,2 100,1,1
100,2,2 100,2,2 100,1,1 100,2,2 100,1,1
100,2,2 100,2,2 100,2,2 100,2,2 100,1,1 100,2,2 100,2,2 100,1,1
100,2,2 100,3,3 100,2,2 100,2,2 100,2,2 100,2,2 100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,4,4 100,3,3
67,3,2 100,6,6 100,5,5 100,5,5 100,4,4 100,1,1 100,4,4 100,3,3 100,2,2 100,4,4 100,3,3 100,3,3
100,4,4 100,5,5 100,5,5 100,5,5 100,2,2 100,4,4 100,4,4 100,4,4 100,1,1
100,1,1 100,4,4 100,3,3 100,4,4 100,2,2 100,4,4
100,6,6 100,7,7 100,6,6 100,5,5 100,5,5 100,7,7 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4 100,3,3 100,4,4 0,1,0
100,4,4 100,7,7 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4
71,7,5 100,5,5 100,6,6 100,6,6 100,4,4 100,4,4 100,4,4
100,6,6 100,6,6 100,8,8 88,8,7 100,5,5
100,5,5
100,1,1
100,4,4 100,4,4 100,4,4
100,4,4 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4
83,6,5 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4 100,4,4
100,5,5 100,8,8 100,7,7 100,4,4 100,8,8 100,8,8 100,4,4
100,4,4 100,4,4
100,5,5 100,4,4 100,4,4
80,5,4 100,5,5 100,6,6 100,4,4
100,1,1 100,4,4