WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Modify title text for Twitter Timeline widget (2 posts)

  1. krimsly
    Member
    Posted 10 months ago #

    Greeting all,

    The Twitter Timeline widget in Jetpack provides a field to set up a title shown before the tweets, such as "Recent Tweets". But I want to modify the title to show "Recent Tweets (@MyTwitterHandle)" where @MyTwitterHandle is a link to my Twitter public timeline.

    I don't think I can put an HTML link within the title field directly from the Jetpack widget setup form for Twitter Timeline. So I think it might take some coding.

    I noticed in looking at jetpack/modules/widgets/twitter-timeline.php line 50 says:

    echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];

    So, I'm wondering if I could do something like add_filter('widget_title'....) to modify the title text, from my theme functions.php file? What is the best way to modify the title so it will be least likely to break in the future, if there are changes to the widget?

    Thanks.

    http://wordpress.org/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    You can indeed use the widget_title filter to customize the output of a widget title. Here is an example of how you could do things:

    http://wordpress.org/support/topic/how-to-make-any-existing-widget-title-clickable?replies=6

Reply

You must log in to post.

About this Plugin

About this Topic