Forums

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

  1. dgraydesign
    Member
    Posted 8 months 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 8 months 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 8 months ago #

    Worked like a charm. Thanks so much, Aaron!

  4. hakaje
    Member
    Posted 2 months ago #

    Thanks so much! mr. aoron

Reply

You must log in to post.

About this Plugin

About this Topic