This is the first post in a series addressing real-life questions that were asked by people who attended my “What is WordPress?” presentation at the Silver Falls Library last autumn. This post examines the question, “What is the difference between menus and widgets?”
What are widgets in WordPress, and how are they different from menus?
This is a great question. I think the concept of widgets probably boggles many users who are new to WordPress, not least because the name does little to explain what they do.
Let’s start with menus, because they are more familiar and therefore more intuitive.
Menu items are links from a page (or post) on your website to other parts of your website. Alternatively, a menu item might link to a page on an external website that you want to promote, such as your various social media profiles.
If you never create and save a menu and associate it with a location within your theme (such as the header navigation menu, sidebar navigation, or footer navigation, depending on your theme) then WordPress will automatically generate a list of every page on your website and include them all in the navigation menu. This might be alright if your site only has a few pages; but on site with more than 6 or 8 pages, you can imagine that this quickly becomes unwieldy. So you create a menu from the interface at Appearance > Menus.
Then you add links to it, and rearrange them into sub-menu items using the convenient drag-and-drop interface.
Widgets, on the other hand, are essentially mini-scripts or programs (please, don’t call them “apps”) that execute within the specified area of your website. Depending on your theme, you can add a widget to your sidebar, your site footer, or even to your content area (by means of shortcodes).
WordPress comes bundled with a number of widgets by default. Many plugins and some “premium” themes introduce additional widget features & functionality that you can add to your website.
Most widgets provide usability enhancement for your website visitors. By default, enabled widgets include the search form; links to your recent blog posts; links to the most recent comments on those blog posts; and links to the administrative login for your website. You may notice that in essence, all of these features are intended to make it easier for your website’s visitors to find relevant content.
The calendar widget in particular adds a nicely styled graphical interface for users to find and access blog posts that were published on a given date.
The ever-popular text widget allows you to add a message to every page that displays it.
From a more technical perspective, menu items are stored in the same wp_posts database table that stores web pages and blog posts, with the difference that menu items are simply identified by a post_type of “nav_menu_item.” Widgets, on the other hand, are built into the WordPress codebase (or the codebase of your plugin, in the case of add-on widgets) and the widget options are stored in the wp_options table. This doesn’t matter at all to the end user; but from a developer perspective, it’s an important distinction.
And that’s the difference between menu and widgets! If you have any additional questions, please contact Mardesco.
More WordPress questions will be answered in future posts, coming soon!