Embedding HTML Widgets in Sidebar

In the past I would have advised most folks not to embed HTML code in the sidebar, because once you change the code, you can’t drag and drop widgets anymore.  Either you modify the code for the sidebar or you use the WordPress widgets available through WordPress.org.  Just recently though, I discovered the Text Widget and now I say embed away.  There is a higher security risk with embedded html code, but that is beyond the scope of this post and I would have to do a lot more research to even explain it.  Many WordPress users embed code without incident, so I suspect we’ll be ok for starters.

Many things you desire to have on your sidebar is available as a plugin, but if you can’t find what you need and still need to embed html code, here is  one way to do it easily and cleanly, without messing around with the sidebar code.

1. Go to Appearance->Widgets
2. Drag the Text Widget to the Sidebar
3. Copy and Paste the HTML code into the Text Widget
4. Save and You Are Done!

Let’s look at an example of when you might consider doing this.  Twitter is a good an example as any.

Your web presence is about style and how well it looks to your audience is important, right?  Of course you do.  So, you may like the way the html based widget looks over pluggable widgets at WordPress.org.

In the case of twitter, there are plugins available through wordpress.org and widgets available from twitter.com as well.

  • The widgets at twitter are flash based and written in html and can be found @  http://twitter.com/goodies/widget_profile.
  • The widgets at WordPress.org can be found by doing a quick search at WordPress.org, keyword “twitter”.

If you like the look and feel of the twitter widget from twitter.com, well then you will need to use the ole copy and paste method described above.

You can leave a response, or trackback from your own site.

Leave a Reply