WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Widget Pro
[resolved] How to customize the "Show follow link" without modifying the (3 posts)

  1. amichel86
    Member
    Posted 1 year ago #

    Hi, here's what I am trying to achieve:

    I want the "show follow link" button to be standard HTML that I can place anywhere. Right now it diplays a twitter styled button with the user count etc.

    I don't see any options in the Widget itself. Is there a way to customize this button without changing the plugin files in case the client updates this plugin?

    Thanks!

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

  2. Aaron D. Campbell
    Member
    Plugin Author

    Posted 1 year ago #

    You could remove the class "twitter-follow-button" which would make Twitter's JavaScript not touch the button at all. To do that, use this code:

    function range_no_twitter_follow( $attributes ) {
    	if ( ! empty( $attributes['class'] ) && 'twitter-follow-button' == $attributes['class'] )
    		$attributes['class'] = '';
    
    	return $attributes;
    }
    add_filter( 'widget_twitter_link_attributes', 'range_no_twitter_follow' );

    There are plenty of other things you could do such as removing the count, etc (http://wordpress.org/support/topic/plugin-twitter-widget-pro-hide-follower-count) if you still want to keep the advantages of thw Twitter JS (which does things like style the button differently if you aleady follow the person, etc).

    More info on the Twitter Follow button: https://dev.twitter.com/docs/follow-button

  3. amichel86
    Member
    Posted 1 year ago #

    Thank you very much, exactly what I was looking for! And another question if I want to display custom text in that link, what would I need to add?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.