WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] Problem with "Custom button" feature (4 posts)

  1. dvascheta
    Member
    Posted 6 months ago #

    Hello!

    I want to use custom set of buttons. What I do:

    1) Select radio "Custom button" in basic settings
    2) Go to https://www.addthis.com/get/sharing , choose the set and style I want, get code:

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_16x16_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_vk"></a>
    <a class="addthis_button_odnoklassniki_ru"></a>
    <a class="addthis_button_twitter"></a>
    <a class="addthis_button_google_plusone_share"></a>
    <a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51f6acb90dd7263c"></script>
    <!-- AddThis Button END -->

    3) Return to wp admin area, paste whole code to box, save

    The problem that saving cuts "<script>" tags and code transforms to:

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_16x16_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_vk"></a>
    <a class="addthis_button_odnoklassniki_ru"></a>
    <a class="addthis_button_twitter"></a>
    <a class="addthis_button_google_plusone_share"></a>
    <a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a>
    </div>
    var addthis_config = {"data_track_addressbar":true};
    
    <!-- AddThis Button END -->

    Please mind standalone line in the end of the code:

    var addthis_config = {"data_track_addressbar":true};

    It is the part of cut <script> tags.

    Not sure if these two <script> lines are important, but I can't keep them after saving.

    https://wordpress.org/plugins/addthis/

  2. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 6 months ago #

    You actually need only this part:

    <div class="addthis_toolbox addthis_default_style addthis_16x16_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_vk"></a>
    <a class="addthis_button_odnoklassniki_ru"></a>
    <a class="addthis_button_twitter"></a>
    <a class="addthis_button_google_plusone_share"></a>
    <a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a>
    </div>

    The <script> tags are removed for security reasons.

  3. dvascheta
    Member
    Posted 6 months ago #

    Ok, thanks!

  4. dvascheta
    Member
    Posted 6 months ago #

    Ok now. Works fine!

Reply

You must log in to post.

About this Plugin

About this Topic