Chapter 6. Building Widgets and Navigation Menus

IN THIS CHAPTER

  • Using widgets in WordPress

  • Building widgets with the widget API

  • Widgetizing your theme

  • Building WordPress Navigation Menus

  • Integrating Navigation Menus with Themes

For many end users, plugin application programming interface (API) is something that doesn't make a whole lot of difference. They know WordPress is easy to use and easy to install. They know they can write posts quickly, get maximum search engine optimization (SEO) benefit, and build traffic. Customization is what they really want, though. They know they want to change the look of their blogs without having to know any code. Fortunately, WordPress' flexible widget system does just that.

Widgets are little pieces of hypertext markup language (HTML) or JavaScript that can be placed on a site to add new functionality. As you travel the Internet, you're likely to find popular widgets in sidebars that list recent posts, comments, popular posts, ads, or blogrolls. Widgets can be anything, and since their adoption in WordPress 2.2, they have become standard fare in WordPress themes and many plugins also provide them.

Widget support used to be provided by a plugin called Sidebar Widgets. While this plugin is still available for older WordPress installs (WordPress 2.1 and earlier), it has been part of the core offering for many years.

Widgets are installed like any other plugin. Simply install widgets in the plugins folder (/wp-content/plugins/) and activate. Like plugins, ...

Get WordPress® Bible, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.