Introduction

In my last article, I discussed the implementation of a Twitter Timeline in your website using Twitter Widgets. Twitter by default provides you with 2 types of themes. They are Light Theme and Dark Theme. However, very often you will encounter a situation where the default themes provided by Twitter does not match your website's theme. For this purpose, Twitter provides you with a set of customizable client-side options that you can use in your embedded code and alter the look of the timeline created using your widgets.
By default, the Twitter embedded timeline looks as in the following after creating a widget
Customize-Twitter-Timelines-created-from-Widgets1.jpg
The final outcome of our changes will make the preceding screen look as in the following
Customize-Twitter-Timelines-created-from-Widgets2.jpg
Before customizing the source code, let us first know the various options provided by Twitter that we can use to configure our timeline. They are explained below:
Now, let us customize it using some options. If you look closely at the embedded code of your Twitter widget, you will see an HTML markup as below
  1. <a class="twitter-timeline" href="https://twitter.com/niteshluharuka" data-widget-id="343079795556491265">Tweets by @niteshluharuka</a>
You just need to change this line with the required options. Based on the preceding options, I have rewritten this markup to display our timeline to be as in the picture above. I have configured the width, height, link color, border color and the number of Tweets displayed on the embedded timeline along with some changes to the layout of the timeline.
  1. <a class="twitter-timeline" href="https://twitter.com/niteshluharuka" width="350" height="400" data-theme="light" data-link-color="#cc0000" data-chrome="noscrollbar transparent" data-tweet-limit="4" data-border-color="#cc0000"
  2. data-widget-id="343079795556491265">Tweets by @niteshluharuka</a>