Twitter Widget Pro
Length of Follow icon (4 posts)

  1. Coombez
    Posted 4 years ago #

    I'm using Twitter widget pro, which is great. it's all working correctly but the follow icon at the bottom of the tweets is to wide for the column, causing to spill over.

    Can it be put over two lines or reduced rather than widening the column?



  2. Aaron D. Campbell
    Plugin Author

    Posted 4 years ago #

    Unfortunately that's something that Twitter embeds. We do however have some limited control over it and here are the parts that might help:

    • We can tell it not to show the follower count
    • We can tell it not to show the username
    • We can give a suggested width. This is not strictly enforced, but Twitter *tries* to make the button fit in that width

    You can use any or all of these. Here is some sample code that you can drop into a plugin or your theme's functions.php file that shows how to do all three:

    function bd_hide_follower_count( $attributes ) {
    	if ( ! empty( $attributes['class'] ) && 'twitter-follow-button' == $attributes['class'] )
    		$attributes['data-show-count'] = 'false';
    		//$attributes['data-show-screen-name'] = 'false';
    		$attributes['data-width'] = '138px';
    	return $attributes;
    add_filter( 'widget_twitter_link_attributes', 'bd_hide_follower_count' );

    Basically all links that Twitter Widget Pro creates are built using a function and have filters set up so you can adjust them. In this case we are only changing the follow button, and we're adding a couple additional attributes (see https://dev.twitter.com/docs/follow-button to understand exactly what they do).

  3. ginez_17
    Posted 4 years ago #

    Thank you very much. Very helpful.

  4. willmcl
    Posted 4 years ago #

    very handy. thanks.

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