amichel86
Member
Posted 7 months 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/
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
amichel86
Member
Posted 7 months 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?