In Part 1 of this tutorial series, we explained the basics of using WordPress widgets.
In this tutorial you are going to learn how to configure various sidebar widgets in WordPress.
Configuring Sidebar Widgets
In a default WordPress installation, your site comes with a number of preinstalled active widgets, such as widgets for displaying external links, filter posts by categories, news items, filter content by tags, etc.
(In a default WordPress installation, your site comes with several active widgets)
Setting Up Widgets On The Blog Sidebar: Step-By-Step Tutorial
In this step-by-step tutorial, you are going to learn how to add, configure and reorder various commonly-used WordPress widgets to display in the site’s sidebar, including:
- Add a clickable Contact Us graphic button linking to the support page.
- Add a Categories section.
- Add a Recent Posts section.
- Adding a list of Pages.
- Display useful Links on the sidebar section.
- Add an RSS Feed section.
- Adding tags to the sidebar through a Tag Cloud.
- Adding and configuring an Archives section to the sidebar.
To access the Widgets area go to Appearance > Widgets …
(WordPress Widgets Menu)
This loads the Widgets screen into your web browser …
(Widgets Panel)
Let’s begin configuring some widgets …
Text Widgets
Text widgets are quite useful …
(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 lets you insert just about anything you want into the sidebar area or other widget sections, such as single lines or paragraphs of text, ads, reviews and more to your site … just type in text or paste HTML into the widget content area. You can also give the widget a title. Remember to save your settings when done …
(Text widgets are extremely versatile!)
Example: Add A Clickable Support Button To Your Sidebar Navigation Menu Using A Text Widget
For this example, let’s set up a clickable help button on the sidebar navigation menu that will take 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 you can use on your own site …
We’ll set up the clickable button to display at the top of the sidebar like in the example shown below …
Step 1 – Upload your image.
To display the clickable button image on your site, the button image must be uploaded to your server. Upload the button graphic to the images folder in your server and note the address of your image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will need this information in Step 3.
For visitors to be taken to your contact page when the help button is clicked, 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 destination page.
Create a contact page on your site and note down its URL …
Step 3 – Compose your text widget code.
Don’t worry … this sounds a lot more technical than it is. In simple terms, you just need to create the instructions for your clickable image.
Your instructions can be typed in a simple text editor and will 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 image below shows which sections of the above code you need to replace with the actual web addresses …
Replace the above URLs and then copy the above code to your clipboard when finished.
If you need help with basic HTML code, see this tutorial:
Go back to your Widgets panel …
(Widgets Screen)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you want your clickable button to display.
In the Available Widgets area, select a Text widget …
(WordPress text widget)
Drag your Text widget to your Active Widgets section and release it at the top of the Widget Area …
(Dragging and dropping your WordPress text widget)
Step 5 – Configure the widget.
Click on the Text widget title bar to configure the widget settings. Paste the code with the links to your contact page and graphic button into your text widget content area and click the save button …
Add a heading to the widget if you want (e.g. “Need Help?”, “Get Help”, etc.) and paste the code with the correct destination links into the large text box, then click the save button …
Note: Make sure to test your contact page and button image links before pasting scripts into the Text Widget, or the 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 paragraphs (note: not required if you type in formatted HTML code like we’re using in the example for this tutorial).
Here is some text added to a Text widget with Automatically add paragraphs box unchecked …
(Automatically add paragraphs option unchecked)
Here is some text with Automatically add paragraphs box checked …
(Automatically add paragraphs box ticked)
***
Step 6 – Refresh the web browser.
Once you have added the widget and HTML code, visit 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 your sidebar menu …
(Clickable button widget on sidebar)
The screenshot above shows ’click for help’ button in the sidebar of a brand new WordPress site.
Step 7 – Test your button.
The last step is to make sure that your destination URL works. Test your button to make sure that your visitors will go to the help page when clicking the button. If you are taken to your contact page, then everything has been set up correctly …
(Test your clickable button)
Tips:
If you want the contact page to open in a new window when visitors click on the support (so they don’t leave the page they’re in), then change the button code from this:
To this (i.e. insert the part containing target=”_blank” in your html code):
When choosing images to add to your sidebar menu, make sure that the width of the image does not exceed the width of your sidebar column, especially if you are using a non-responsive WordPress theme. Note that some themes can display different column widths depending on their templates and their layout. Some sidebars may be wider or narrower. If the sidebar of your theme is narrower than the width of the button images, then you may have to either adjust the size of your images, or the column width to make graphics display correctly on your sidebar section.
(Make sure the image width does not exceed the width of the sidebar column)
More Tips:
- If you don’t want the button image to be centered 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 like (e.g. to an external site, contact form, forum, etc.) and change this anytime by editing the code inside your text widget.
***
This is the end of part two of this series of tutorials.
To view Part Three, click this link:
***
"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