O'Reilly logo

WordPress 3 Complete by April Hodge Silver

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Widgets

Writing a widget bears some similarities to writing a plugin, but in some ways it's easier because there is a widget class that you can leverage for some of the functionality.

Recent posts from a Category Widget

In this section, we will see how to write a widget that displays recent posts from a particular category in the sidebar. The user will be able to choose how many recent posts to show and whether or not to show an RSS feed link. It will look like the following screenshot:

Recent posts from a Category Widget

Let's get started!

Naming the widget

Widgets, like plugins, need to have a unique name. Again, I suggest you search the Web for the name you want to use in order to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required