Twitter Widget Pro
[resolved] Hide counter (5 posts)

  1. dgraydesign
    Posted 2 years ago #

    I'm trying to hide the counter that's next to the follow button in my style sheet, but none of the code I've used will work. Using:

    .btn-o, .count-o, .btn, .btn .label, #count {display:none;visibility:hidden;}


  2. Aaron D. Campbell
    Plugin Author

    Posted 2 years ago #

    That count is actually in an iframe showing from Twitter's site, so you don't have much control over it using CSS. However, there *is* a way to hide it. 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.

  3. dgraydesign
    Posted 2 years ago #

    Worked like a charm. Thanks so much, Aaron!

  4. hakaje
    Posted 2 years ago #

    Thanks so much! mr. aoron

  5. Ramzii
    Posted 2 years ago #

    How about changing the locale language of this follow button?

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