Twitter Widget Pro
[resolved] How to customize the "Show follow link" without modifying the (3 posts)

  1. amichel86
    Posted 3 years ago #

    Hi, here's what I am trying to achieve:

    I want the "show follow link" button to be standard HTML that I can place anywhere. Right now it diplays a twitter styled button with the user count etc.

    I don't see any options in the Widget itself. Is there a way to customize this button without changing the plugin files in case the client updates this plugin?



  2. Aaron D. Campbell
    Plugin Author

    Posted 3 years ago #

    You could remove the class "twitter-follow-button" which would make Twitter's JavaScript not touch the button at all. To do that, use this code:

    function range_no_twitter_follow( $attributes ) {
    	if ( ! empty( $attributes['class'] ) && 'twitter-follow-button' == $attributes['class'] )
    		$attributes['class'] = '';
    	return $attributes;
    add_filter( 'widget_twitter_link_attributes', 'range_no_twitter_follow' );

    There are plenty of other things you could do such as removing the count, etc (http://wordpress.org/support/topic/plugin-twitter-widget-pro-hide-follower-count) if you still want to keep the advantages of thw Twitter JS (which does things like style the button differently if you aleady follow the person, etc).

    More info on the Twitter Follow button: https://dev.twitter.com/docs/follow-button

  3. amichel86
    Posted 3 years ago #

    Thank you very much, exactly what I was looking for! And another question if I want to display custom text in that link, what would I need to add?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Twitter Widget Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.