How to add a twitter feed to your wordpress site

Summary: Get twitter to generate some HTML that you copy-paste to a widget on your WordPress site.

Here are the steps in more detail:

1) Head over to twitter and generate a personalised HTML code

Navigate to twitter, and log in. Then click on the cog at the top right of the screen, then settings, widgets, then ‘create widget’. (As a shortcut, here is the direct link to the twitter widget page)

2) Which widget type should I choose?

Each tweet feed looks very similar, and is embedded into your site in the same way, but they display different information:

  • User timeline – displays your tweets. You can choose whether or not to include replies.
  • Favorites – Displays all the tweets favourited by a chosen account. Doesn’t have to be your own account.
  • A list – Displays all the tweets by members of one of your twitter lists.
  • A search feed – displays tweets matching a search term. This is where you can display hashtags. Eg (remove the quotation marks) “#ds106” or “digital communications”. You can also do fancier searches using boolean terms – eg on my digital storytelling site I have a stream that searches for “martinlugton and #ds106” to highlight my ds106 tweets.

3) Click ‘create widget’, then copy the HTML code to your WordPress page and put it in a widget.

Go to the widgets area of your WordPress admin backend.Grab a widget of the type ‘text’ and drag it to the appropriate widget. (A widget is just an area of your page. Each theme has different widgets, so take a minute to work out where exactly you want to place yours.)The width automatically adjusts to the width of the area (div) you place it in.

4) The result should look something like this:

two examples of a twitter timeline widget