Sharing Customization

X Post Button

Use the following code as a template for displaying an X Post button (formerly the Twitter Tweet button).

Default X Post button

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

<script defer 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_twitter_tweet"></a>

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


Custom X Post button

Each X Post button is independently customizable by specifying supported data attributes. For example, you can target a specific URL to share, attribute an X username, specify hashtags, and more.

<div class="a2a_kit">
    <a class="a2a_button_twitter_tweet" data-lang="es" data-url="https://example.com/" data-via="AddToAny"></a>
</div>

<script defer src="https://static.addtoany.com/menu/page.js"></script>
<a class="a2a_button_twitter_tweet" data-lang="es" data-url="https://example.com/" data-via="AddToAny"></a>