My picture
Wednesday, January 20, 2021
2006 | 04 | 17 | Blog | Dev | WordPress
Enter your email address above to start
receiving email updates from this site.
This Page
Post Meta

WordPress Widgets

WordPress Widgets

Widget Compatible Themes « WordPress Support

SridhaReena: CMS, Scripts, Software, Technology tidbits, WordPress, and everything Internet

Ruidoz » Blog Archive » widgetizar


Little Logos ::

Netlex News


Support WordPress France / Crer ses propres widgets avec Theme Widgets

Support WordPress Francophone / [Rsolu] Crer ses propres widgets avec Theme Widgets

Standing Tall » WordPressウィジェット一覧

No Not Again! news - find out everything that's going on.


Introducing Theme Widgets
April 17, 2006

So you’ve just completed your upgrade to WordPress 2.x. You’ve installed the latest and greatest versions of your favorite plugins. You’ve lovingly tweaked your favorite theme to within an inch of its life. All is well with the world.

Then the WordPress development team comes along and introduces the brand new WordPress Widgets: slick chunks o’ code that make it easy to modify your WordPress-powered site’s sidebar from a simple drag-and-drop menu. Overnight there’s a new widget blog, a flurry of rejiggered themes, and the utterly grotesque new jargon “to widgetize.”

The good news? Customizing a third-party WordPress theme is much, much easier for end-users.

The bad news? While coding up a widget isn’t rocket science, it’s beyond the PHP skill level of most theme designers. (Those who want end-users customizing their themes, that is.)

As a result, there’s an awful lot of perfectly good code suddenly consigned to the dustbin. On the flip side, there’s been a ton of energy devoted to creating widgets that are essentially wrappers for existing plugins.

Wouldn’t it be better if making widgets were as simple as making theme template files? Well, now it can be that simple thanks to modifications I made to a sample widget by plugin writer Kaf Oseo.

Here’s how it works:

  1. Download and install the WordPress Widgets plugin.

  2. Download and install my Theme Widgets plugin.

  3. If you are not using the WordPress default theme (Kubrick) or a theme that has already been updated to be widget-friendly, follow the instructions for enabling the dynamic sidebar.

  4. For each widget you want to offer, create a file with the appropriate code in your theme folder using a name that begins with widget- or widget_.

    For example, try creating a file named widget-example.php in your theme file with the following contents:

    Widget Name: Theme Widgets Example
    print("<p>This is an example of the Theme Widgets plugin.</p>");	
  5. Go to the “Sidebar Widgets” item in the presentation menu. At the bottom of the page you should have a new dialog box that lets you set the number of theme widgets:

    How many theme widgets would you like?

  6. Then find "Theme Widget 1" in the “Available Widgets” box above and click on the widget options icon (where the blue arrow is pointing below).

    Click on the theme widget control

  7. You should see a dialog box like this one:

    Select a widget from the WordPress Default Theme folder

  8. Just click on the radio button for the theme widget you want — in this case you’ll obviously just have the one widget-example.php to choose from — and fill in the optional title and text fields if you’d like.

  9. The close the widget and be sure to click on the “Save changes” button, which may not be visible on your screen unless you scroll down.

    Save changes

  10. If all goes well, the next time you visit your site you should see “This is an example of the Theme Widgets plugin.” in your new sidebar. You’re now in business!

So there it is: ten simple steps to theme widget happiness. It’s so easy, it’s Automaggic!