In Part One of this step-by-step tutorial, we explained the basics of how to use widgets in WordPress.
In this section you will learn how to configure several sidebar widgets in WordPress.
Configuring Sidebar Widgets
In a default WordPress installation, your site comes with several pre-installed active widgets, such as widgets that let you display links to your pages, recent posts, text or HTML banners, adding a search box, etc.
(In a default WordPress installation, your site comes with several pre-installed widgets)
How To Add And Configure Frequently-Used WordPress Widgets On The WordPress Sidebar Navigation Area: Tutorial
In this step-by-step tutorial series, you are going to add, configure and reorder various commonly-used WordPress widgets to display in the site’s sidebar, including:
- Add a Support button linking to the help page.
- Add a Categories section with a drop down menu.
- Adding a Recent Posts section to display the latest posts.
- Adding a list of your site’s main Pages.
- Display a list of useful Links on your sidebar.
- Display news items using an RSS Feed section.
- Add a Tag Cloud.
- Configure how Archived Posts display on your sidebar.
The Widgets section is located inside the WP dashboard and can easily be accessed by going to Appearance > Widgets …
This brings you to the Widgets screen in your browser window …
Let’s start configuring your sidebar widgets …
Adding Text Widgets
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)
Text widgets let you insert just about anything you want into your sidebar or other widget sections, such as lists, maps and directions, scripts and more to your site … simply by typing in text or adding HTML into the content area. You can also give the widget a title. Remember to save your settings …
(A text widget is really useful!)
Example: Use A Text Widget To Add A Clickable Help Button To Your Sidebar Menu
For this example, let’s set up a contact button on your sidebar menu that takes 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 “help button” graphic image that your visitors can click on …
We’ll set up the clickable Help button to display at the top of the sidebar like in the example shown below …
Step 1 – Upload your image.
To display an image on your site, first you must upload the button image to a folder on your server and note the address of your image location.
This information will be required in Step 3.
In order for visitors to go to your contact page when they click on the support button, either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will then link your button graphic to this URL in Step 3 …
Step 2 – Add the support page.
Create a contact page and note its URL …
Step 3 – Compose your text widget code.
Don’t worry … this sounds a lot more technical than it is. Basically, you just need to create the instructions for your clickable button.
Your instructions can be composed in a simple text editor and should look something like this …
- Replace “http://www.yourdomain.com/contact-us” in the code above 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 code you will need to replace with the actual contact page and image URLs …
Replace the above URLs and then copy all of the above code to your clipboard when finished.
If you need help figuring out basic HTML code, see this tutorial:
Next, go back to your Widgets area …
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where the support button should display.
In the Available Widgets area, find the Text widget …
Drag your Text widget to the Active Widgets section and release the widget at the very top of the Widget Area …
(Drag and drop your WordPress text widget)
Step 5 – Configure the text widget settings.
Click on the 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 section to the widget if you want (e.g. “Need Help?”, “Get Help”, etc.) and paste the code with the correct URLs into the Content area, then click Save when done …
Note: Remember to check all URLs before pasting scripts into the Text Widget, or the button won’t 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: not required if you’re typing in code like we’re doing in this tutorial).
Here is some text with Automatically add paragraphs option not ticked …
(Automatically add paragraphs box not checked)
Here is some text with Automatically add paragraphs option ticked …
(Automatically add paragraphs box selected)
Step 6 – Refresh your browser.
Once you have added the text widget and formatted content, go to the front-end of your site and refresh the browser. If you have entered all of the links correctly, then your support button will display at the top of the site’s sidebar menu …
(Clickable support button widget on blog sidebar)
The above screenshot shows the contact button added to a brand new WordPress site.
Step 7 – Test your button.
The last step is to ensure that the destination link works. Test this by clicking the button. If you are taken directly to the support page, then your text widget has been set up correctly …
(Test your text widget to ensure you’ve set up everything correctly)
If you would like the contact page to open in a new window when visitors click on the help (so they don’t leave the page they’re in), then change the code from this:
To this (i.e. include the part that says: target=”_blank” in your html code):
When choosing images to add to your sidebar menu, make sure that the width of your image doesn’t exceed the width of your sidebar column, especially if you are using a non-responsive WordPress theme. As mentioned earlier, some themes can display elements differently depending on their templates and their layout. Some sidebars are wide and some are narrow. If the sidebar of your theme is narrower than the width of your button images, then you may need to either adjust the size of your images, or the column width to make images display correctly on your sidebar section.
(Adjust column width or reduce image size)
- If you don’t want to center the image inside the sidebar, delete the <center> and </center> tags from the beginning and end of the line of code. The image will then be left-aligned.
- You can link your contact button to any URL you want (e.g. to an external site, helpdesk, FAQ page, etc.) and change this anytime by editing the content in your text widget.
This is the end of part two of this series of tutorials about using Widgets.
Click on this link to view Part Three:
"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com