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

  1. krimsly
    Posted 2 years 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?



  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 2 years 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:


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic