WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Widget Pro
[resolved] Hide "Follow [USERNAME]" and Followers on Widget? (2 posts)

  1. ChristinaHendriks
    Member
    Posted 1 year ago #

    Hello again,

    My client would like me to hide the '"Follow [USERNAME]" <-## Followers' button on the Twitter Widget Pro. They would like it to only show the little bird icon instead. Is this possible for me to code? Or does it involve modifying the widget as a whole?

    Any thoughts are welcome, thank you!

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

  2. Aaron D. Campbell
    Member
    Plugin Author

    Posted 1 year ago #

    You can't hide the word follow. You can hide the count and the username if you want. Here's info about what parameters the follow link can use: https://dev.twitter.com/docs/follow-button

    You can add some of those parameters by adding code like this to another plugin or to 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' );

    You can add any of the attributes you find in that link

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.