[Plugin: Social Media Tracking] Twitter button missing.. and the fix I made
-
I just installed the latest version of the Social Media Tracking plugin (v2.2) on WP 3.2.1. I noticed that the twitter button was not displaying where it should – I only got a text link. Here’s what I did to get it to show up.
- Go to Plugins > 42functions Social Media Tracking > Edit
- Click on social-media-tracking/buttons/Twitter.php
-
Find the section of code that says
return '<a href="https://twitter.com/share" class="twitter-share-button" data-url="'.get_permalink().'" data-text="'.get_the_title().'" data-count="'.$this->option('button').'">Tweet</a>';
-
change it to
return '<a href="https://twitter.com/share" class="twitter-share-button" data-url="'.get_permalink().'" data-text="'.get_the_title().'" data-count="'.$this->option('button').'">Tweet</a>' . "\n" . '<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>';
- Save your changes
If you know PHP, you’ll probably notice that I just appended a nextline character and
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
to the string.I found a snippet of sample code for embedding a twitter button in the above link, which I used as the basis for this fix. It also contains a link to this plugin.
- The topic ‘[Plugin: Social Media Tracking] Twitter button missing.. and the fix I made’ is closed to new replies.