'Build Your Own' social media buttons not appearing at the bottom of posts
-
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.
- The topic ‘'Build Your Own' social media buttons not appearing at the bottom of posts’ is closed to new replies.