O'Reilly logo

Beginning WordPress 3 by Stephanie Leary

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

Chapter 8. Creating Widgets

Widgets are the building blocks of WordPress sidebars. They can be created in a theme's functions file or in a plugin.

In this chapter, I'll show you how I created two of my plugins, Recent Posts From Category and Dashboard Notepad. You'll see how to create these widgets as part of a theme's functions file, and in the next chapter I'll show you how to transform them into plugins.

While these two plugins create widgets, note that plugins can do any number of other things. Widgets are limited to displaying a bit of content inside the widget areas you defined in your theme's functions.php file back in Chapter 6.

Basic Widgets

WordPress widgets are classes, which makes them easy to duplicate, even if you've never worked with ...

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