WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. dgraydesign
    Member
    Posted 1 year 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;}

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

  2. Aaron D. Campbell
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

    Worked like a charm. Thanks so much, Aaron!

  4. hakaje
    Member
    Posted 1 year ago #

    Thanks so much! mr. aoron

  5. Ramzii
    Member
    Posted 1 year ago #

    How about changing the locale language of this follow button?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic