Widgets and sidebars help you display additional content in different areas of a WordPress website, such as a sidebar, footer or other widget-ready area.
A widget is a component that displays specific content or functionality in a supported area of a website. Depending on the theme, widgets may display recent posts, categories, search forms, calendars or other information.
Available areas depend on your theme.
A sidebar is an area of a website that displays supporting content alongside the main content. It commonly appears on blog pages, article pages and archive pages.
This area displays the article, page content or blog post.
Example: Introduction to HTML and CSS.
Search
Recent Posts
Categories
Useful Links
| Feature | Widget | Sidebar |
|---|---|---|
| Meaning | A component that displays content or functionality. | A layout area that can hold supporting content. |
| Example | Search form or Recent Posts. | Blog sidebar beside an article. |
| Purpose | Adds a particular feature or content. | Organizes additional content in a layout. |
| Relationship | Can be placed in a supported area. | Can contain widgets or blocks, depending on the theme. |
Classic themes commonly provide a Widgets screen where you can add, remove and rearrange widgets in registered areas.
Modern block themes often use the Site Editor to manage layout areas instead of the traditional Widgets screen. You can use blocks to add content to templates and template parts.
| Name | Purpose | Example Use |
|---|---|---|
| Search | Allows visitors to search website content. | Search tutorials by topic. |
| Recent Posts / Latest Posts | Displays recently published posts. | Show new programming lessons. |
| Categories | Displays post categories. | HTML, CSS and JavaScript. |
| Archives | Provides links to posts grouped by date. | Browse posts by month. |
| Recent Comments | Displays recent visitor comments. | Show recent discussion activity. |
| Custom HTML | Displays custom HTML content. | Embed a supported HTML snippet. |
| Navigation | Displays links to important pages. | Show useful course links. |
A search component helps visitors find posts and pages without manually browsing every section of the website.
In the WordPress editor, add a Search widget or Search block, depending on your theme. You can then place it in the desired sidebar, footer or template area.
Recent Posts or Latest Posts can help visitors discover newly published articles and tutorials.
These are sample titles. A real Recent Posts widget or Latest Posts block displays posts from your WordPress site.
Categories help visitors browse posts by subject. A training website might organize tutorials into categories such as programming, computer basics and office applications.
These labels are examples. Create and assign actual post categories in WordPress before displaying them.
In themes that support the classic Custom HTML widget, you can display custom HTML content in a widget area. Block themes may provide a Custom HTML block instead.
<div class="training-box">
<h3>Join Our Courses</h3>
<p>Learn computer skills and programming.</p>
<a href="/courses/">View Courses</a>
</div>
This snippet displays a heading, paragraph and link.
Change /courses/ to the correct page on
your website. Add CSS separately if you want to style it.
Use a theme that provides a sidebar or an appropriate template area. Complete these tasks:
Challenge: Create a learning website sidebar with Search, Latest Posts, Categories and a course promotion section.
Choose the correct answer for each question.