WordPress.org

Forums

Twitter Widget Pro
[resolved] Hide follower count (6 posts)

  1. greencode
    Member
    Posted 3 years ago #

    There's a shortcode to hide the follow button but is there a shortcode to hide just the followers count?

    http://wordpress.org/extend/plugins/twitter-widget-pro/

  2. J. Gay
    Member
    Posted 2 years ago #

    I'm looking for a solution to the same problem, if anyone has an answer yet. Thanks!

  3. Aaron D. Campbell
    Member
    Plugin Author

    Posted 2 years ago #

    There's no option for this, but there IS a filter in the code so that you can do this if you want. Add this code to the end of your theme's functions.php file:

    function range_hide_follower_count( $attributes ) {
    	if ( ! empty( $attributes['class'] ) && 'twitter-follow-button' == $attributes['class'] )
    		$attributes['data-show-count'] = 'false';
    
    	return $attributes;
    }
    add_filter( 'widget_twitter_link_attributes', 'range_hide_follower_count' );

    That will add a new data element to the follow link, which tells Twitter you don't want to show your follow count.

  4. J. Gay
    Member
    Posted 2 years ago #

    Thanks, Aaron. I had just figured out how to do this in the widget's php file but your solution is much better!

  5. heisdnice
    Member
    Posted 2 years ago #

    thanks

  6. indirectdesign
    Member
    Posted 2 years ago #

    Many thanks, Aaron, very useful!!

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