WP-Fun.co.uk

Widgets Easy

Widgets in WordPress 2.7 are a pain the rump to build. So much so that I wrote a plugin called Fun with Theme Widgets, which took specifically built files from a theme folder and created widgets out of them. In 2.8 however widgets are far easier to create, which leads me to wonder whether they are now easy enough for the average WordPress user to dive into.

The new widget system actually makes it hard for me to update this plugin so chances are it will stop working from 2.9 onwards. However, there are so many widgets out there that will take PHP code directly, or plugins that let you choose the parameters of a query (which posts to get, which categories to get, etc) that I wonder whether normal users ever need to create widgets anyway.

If you haven’t yet had a chance to see how the new widgets are created I recommend you take a quite read of Build a WordPress 2.8 Widget over at Wp Engineer. I think you will agree that it is pretty easy.

I don’t think that there is a massive gap between changing your own theme and using the template at the top of that post to create your own multiple use widget in functions.php but I am not an average user. So tell me, firstly, how comfortable would you be writing your own widgets with this?

Secondly, and more importantly, do you think there will ever come a time when you need to create your own widget anyway?