Embedding the Twitter widget on your website the right way



Twitter has a widget that you can put on your website to allow users who are already signed in to follow you automatically and send you a message. There’s a problem that happens when installing this tool that Twitter doesn’t make you aware of, at the time of this writing, on their website.

When I first used it, it worked very well but then when I tried using it on a WordPress site, it worked for a while and then stopped working. All you saw in place of the box was @your-username. After a bit of trial and error and mostly searching for the best solution, I found the answer. The reason it broke was because Twitter updated their API.

Twitter’s form asks you to put in your domain name and that in itself is deceiving. With the new API changes, whether you put in your domain name at root (http://your-domain.com) or with the preceding sub-domain (http://www.your-domain.com), you still see the @your-username substitute text instead of the Twitter widget.

The solution is the wildcard symbol, the asterisk. Which means, if any/or of these domains exists then do such action. Therefore as the solvent to wherein the Twitter form asks for your domain name, you write in: *.your-domain.com


Start a conversation about this post

%d bloggers like this: