WordPress Sharing Customization

Facebook Like Button

Use the following code as a template for displaying a Facebook Like button.

Default Facebook Like button

<div class="a2a_kit a2a_default_style">
    <a class="a2a_button_facebook_like"></a>
</div>

<script async src="https://static.addtoany.com/menu/page.js"></script>

Add the following HTML code, for example, to the "Service Buttons HTML code" box in Drupal Configuration > Web services > AddToAny > Buttons > Service Buttons.

<a class="a2a_button_facebook_like"></a>

In WordPress, the Facebook Like button is available by clicking the "Add/Remove Services" button in Settings > AddToAny > Share Buttons.

Note: When the Do Not Track option is enabled in a browser, AddToAny prevents the Like button from loading to prevent Facebook tracking across sites.


Custom Facebook Like button

Each Facebook Like button is independently customizable by specifying any Facebook Like button attribute as a data attribute. For example, you can change the Like button to a Recommend button, display the number of shares above the button, target a specific URL to share, and much more.

In WordPress, the Facebook Like button is available by clicking the "Add/Remove Services" button in Settings > AddToAny > Share Buttons. Click the down arrow below the Like button to "Show count" or change "Like" to "Recommend".

<div class="a2a_kit">
    <a class="a2a_button_facebook_like" data-action="recommend" data-href="https://www.example.com/" data-layout="box_count" data-width="55"></a>
</div>

<script async src="https://static.addtoany.com/menu/page.js"></script>
<a class="a2a_button_facebook_like" data-action="recommend" data-layout="box_count" data-width="55"></a>

This is Facebook's Recommend button in the box count layout.

<div class="a2a_kit">
    <a class="a2a_button_facebook_like" data-href="https://www.example.com/" data-layout="standard" data-show-faces="true" data-width="450"></a>
</div>

<script async src="https://static.addtoany.com/menu/page.js"></script>
<a class="a2a_button_facebook_like" data-layout="standard" data-show-faces="true" data-width="450"></a>

This is Facebook's Like button set to show faces, which requires a standard layout with a wide width.

Note: Facebook directly serves the Facebook Like button, so customization is limited to what Facebook offers. For further customization and faster loading, use AddToAny's standard Facebook share button or your own custom button.