In Part One of this step-by-step tutorial series, we explained the basics of using WordPress widgets.
In this tutorial you are going to learn how to begin configuring a number of sidebar widgets in WordPress.
Widget Configuration
In a default WordPress installation, your site comes with a number of built-in widgets that can be used out of the box with little to no configuration required, such as widgets that let you display links to your pages, filter posts by categories, text or HTML banners, filter content by publish dates, etc.
(In a default WordPress installation, your site comes with a number of built-in widgets)
How To Add Sidebar Widgets In WordPress: Step-By-Step Tutorial
In this tutorial series, you will learn how to add, configure and reorder various widgets, including:
- Adding a clickable Contact Us image linking to the contact page.
- Add a Categories section.
- Adding a Recent Posts section to display your latest posts.
- Adding a list of the site’s most important Pages.
- Display a list of useful Links on your sidebar.
- Display news items with an RSS Feed section.
- Add a Tag Cloud.
- Configure how your Archived Posts display on the sidebar navigation section.
To use widgets, access the Widgets area located inside your admin by going to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets panel in your web browser …
(Widgets Panel)
Let’s start by learning how to configure a text widget …
Add A Text Widget
Text widgets are incredibly versatile …
(WordPress Text widget)
Rich Text Widget
From version 4.8 onward, WordPress has added native rich-text editing capabilities to text widgets …
(Rich Text Widget)
This lets you quickly and easily format text, create lists, add emphasis, and insert links into your sidebar text …
(Format text easily with the new text widget)
A text widget can be used to add notices, ads, special promotions and more to your site … just type in text or insert HTML into the content area. You can also add an optional title in the Title field. Remember to save your settings …
(A text widget is versatile!)
Example: Using A Text Widget To Add A Clickable Help Button To The Sidebar Navigation Area
For this example, we’ll set up a clickable support button on the sidebar area that takes your visitors to a page on your site (or an external site, e.g. a helpdesk) where they can contact you for help and support.
First, you will need to create or source a graphic image that your visitors can click on …
We’ll set up the clickable Help button to display at the top of your sidebar like in the example shown below …
Step 1 – Upload your image.
To display the clickable image on your site, the button image must be uploaded to your server. Upload your button graphic to the images folder in your server and note the path to your image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
This information will be used in Step 3.
For someone to go to the contact page when the help button is clicked, you must either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will link the button image to this URL in Step 3 …
Step 2 – Add your contact page.
Create a contact page and note down its URL …
Step 3 – Create the code for your text widget.
If you’re not a technical-minded person, don’t worry … this sounds a lot more technical than it is. Basically, we just need to create the instructions for your clickable button.
Your instructions can be typed into a plain text file and will look something like this …
- Replace “http://www.yourdomain.com/contact-us” in the code with the URL of your contact page location.
- Replace “http://yourimagelocation.com/img/supportbutton.jpg” in the code above with the URL of your image location.
The screenshot below shows which sections of the above sample code you need to replace with your actual contact details …
Replace the above URLs and then copy all of your text file content to your clipboard when finished.
If you need help figuring out basic HTML code, see this tutorial:
Go back into your Widgets area …
(Widgets Panel)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where your clickable button should display.
In the Available Widgets area, select the Text widget …
(WordPress text widget)
Drag your Text widget to your Active Widgets section and release it at the very top of the Widget Area …
(Dragging and dropping your WordPress text widget)
Step 5 – Configure the text widget.
Click on the Text widget title bar to configure the widget settings. Paste the code with the URLs to your contact page and graphic button into your text widget content area and click the save button …
Add a title to the widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct destination URLs into the Content box, then click Save when done …
Note: Make sure to test all links before pasting scripts into the Text Widget, or the clickable button will not work.
*** If using WordPress version pre-4.8 ***
If you’re adding text with no formatting tags like paragraph breaks, you may want to tick the Automatically add paragraphs box to wrap each block of text in an HTML paragraph code (note: this is not necessary if you’re pasting in formatted HTML content like we’re using in the example for this tutorial).
Here is some text with Automatically add paragraphs box unchecked …
(Automatically add paragraphs box not ticked)
Here is some text with Automatically add paragraphs box checked …
(Automatically add paragraphs box selected)
***
Step 6 – Refresh your browser.
After adding your widget and formatted content, visit your site and refresh your browser. If all links have been entered correctly, then the clickable support button should display at the top of your sidebar menu …
(Clickable support button widget on blog sidebar)
The screenshot above shows a clickable button in the sidebar area of a brand new WordPress site.
Step 7 – Test the widget.
The last step is to make sure that the destination link works. Test the button to make sure that visitors will go to the support page when they click on the graphic image. If you are taken to your support page, then the text widget has been set up correctly …
(Test your clickable button)
Useful Tips:
If you would like the contact page to display inside a new window when visitors click on the support (so they don’t leave the page they’re on), then change the code from this:
To this (i.e. add the section containing target=”_blank” in your text widget code):
When choosing images to add to your sidebar section, make sure that the width of the image doesn’t exceed the width of the sidebar column, especially if you are using a non-responsive WordPress theme. As mentioned earlier, some themes may display different column widths depending on their templates and layout. Some sidebars are wide and some are narrow. If the sidebar of your theme is narrower than the width of your button image, then you may need to either adjust the graphic size, or the width of your sidebar column to make elements display correctly on your theme.
(Make sure that the image width does not exceed the sidebar column width)
Additional Tips:
- If you don’t want to center the button image in your sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then align to the left.
- Link the support button to any destination you want (e.g. to an external site, contact form, FAQ page, etc.) and change this anytime by replacing the links inside your text widget.
***
This is the end of part two of this tutorial.
Click on this link to continue:
***
"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum