XF 1.5 How to replace Tweet with Follow button in sidebar_share_page

How do I replace the Tweet button with Follow in the sidebar?

I can't be the only one who thinks that Follow makes more sense than Tweet in the sidebar. There are few scenarios under which a visitor would start randomly tweeting about a forum, whereas following is a more natural action if someone likes the site.


XenForo moderator
Staff member
You would have to edit the template and add the follow code for your Twitter account.

See the guides here for how to determine and edit the template: How To...
I never managed to do this properly. This is the current code in that template:

<xen:if is="{$xenOptions.tweet.enabled}">
                    <div class="tweet shareControl">
                        <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"
                            data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
                            {xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
                            {xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
And these are Twitter's instructions:
How to add a Follow button to your website
1. Create a new anchor element with a twitter-follow-button class to allow Twitter’s widgets JavaScript to discover the element and enhance the link into a Follow button. Set a href attribute value of a Twitter profile URL.
<a class="twitter-follow-button"
Follow @TwitterDev</a>
2. Customize Follow button parameters using data-* attributes.
<a class="twitter-follow-button"
Follow @TwitterDev</a>
3. Asynchronously load Twitter’s widgets JavaScript using our loading snippet. The JavaScript snippet will check for an existing version of Twitter’s widgets JavaScript on the current page, initialize a function queue to be executed once the widgets JavaScript has loaded, and load the widgets JavaScript asynchronously from Twitter’s CDN.
Since XenForo already includes Twitter's javascript, I skipped that part, but the button does not render. Do I need to include Twitter's JavaScript again?