WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
'Build Your Own' social media buttons not appearing at the bottom of posts (5 posts)

  1. pjh5000
    Member
    Posted 8 months ago #

    I recently updated this plugin to the latest version (v3.5.3). After the update however, the AddThis social media buttons stopped appearing on my blog site.

    The website is set up to display a selection of buttons from a variety of social media services at the bottom of each blog post, using the 'build your own' option within the plugin settings, in conjunction with the 'services to always show' option. The plugin is configured to show these buttons on the homepage, on pages, archives and categories. No buttons are set to appear at the top of posts.

    I tried deactivating all plugins except for AddThis, and reverting to the default Twenty Thirteen theme. The buttons were still not being displayed. I also tested this both with WordPress version 3.6.1 and version 3.7.1. The problem occurred with both versions.

    Upon further investigation, it appears that this problem was introduced in version 3.5.2 of this plugin - the buttons were successfully appearing in all previous versions.

    I therefore checked the differences in code between v3.5.1 and v3.5.2 of the AddThis plugin. It seemed that the introduction of the following IF statement prevented the buttons from appearing:

    if (isset($options['type']) && $options['type'] != 'custom_string') {

    This line appears within the addthis_custom_toolbox() function within the addthis_social_widget.php file. In plugin version 3.5.3, it is located on line 382. Commenting out the If statement (but leaving the code within it intact) caused the buttons to reappear on the site again.

    I then came up with what is hopefully a better fix for this issue, by restoring the if statement, and then adding the following line of code on line 1507 of v3.5.3 of the plugin, within the addthis_display_social_widget() function:

    $belowOptions['type'] = $options['below'];

    This caused the buttons to reappear at the bottom of posts on the site.

    Can you verify that this change does not cause any other negative implications, and if so, please can it be incorporated into the latest release of the plugin?

    Many thanks - please let me know if I can provide any further information.

    http://wordpress.org/plugins/addthis/

  2. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 8 months ago #

    @pjh5000: That's a good catch! Thanks for reporting it in detail, and we will fix it in the upcoming release. We will check if your fix break anything else, and if it does we will update you here. Thanks again!

  3. pjh5000
    Member
    Posted 8 months ago #

    Fantastic, thank you! :)

  4. Thomas van der Westen
    Member
    Posted 6 months ago #

    Any updates?

  5. Courtney Fantinato
    Member
    Posted 5 months ago #

    I've posted about having issues with building my own as well (http://wordpress.org/support/topic/php-error-undefined-variable-button-on-line-448) and there hasn't been a fix. Stuck on version 3.5.1.

Reply

You must log in to post.

About this Plugin

About this Topic