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 several WordPress sidebar widgets.
Configuring Commonly-Used WordPress Widgets
In a default WordPress installation, your site comes with a number of built-in widgets that can be used out of the box with minimal to no configuration needed, such as widgets that let you display links to your pages, recent posts, text or HTML banners, add tag clouds, etc.
(In a default WordPress installation, your site comes with several preinstalled widgets)
How To Configure Widgets On Your Sidebar: Step-By-Step Tutorial
In this tutorial, you will learn how to add, configure and reorder s number of widgets to display in your site’s sidebar menu, including:
- Add a clickable Support graphic button linking to the contact page.
- Add a Categories section.
- Add a Recent Posts section.
- Add a list of Pages.
- Display a list of useful Links on the sidebar.
- Add an RSS Feed section.
- Adding a Tag Cloud.
- Adding and configuring an Archives section to your sidebar.
To access the Widgets area log into your WordPress dashboard and go to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets section into your web browser …
(Widgets Screen)
Let’s get started …
Adding Text Widgets To The Sidebar
Text widgets are versatile …
(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 navigation menu or other widget sections, such as quotes, maps and directions, reviews and more to your site … just type in text or insert HTML into the widget content area. You can also give the widget a title. Remember to save your settings …
(Text widgets are very useful!)
Example: Use A Text Widget To Add A Contact Button To The Sidebar Section
For this example, let’s set up a support button on the sidebar area that will take 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 the sidebar like in the example shown below …
Step 1 – Upload your image.
Upload the graphic image to your server’s images folder and note the address of your server’s image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
This information will be used in Step 3.
For someone to be taken to your contact page when the support button is clicked, either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will then link the button image to this URL in Step 3 …
Step 2 – Add a support page.
Create a contact page on your site and note the page URL …
Step 3 – Create the HTML 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. In simple terms, we just need to create the instructions for your clickable button.
Your code can be composed in a plain 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 with the URL of your image location.
The image below shows the sections of the above sample code that you need to replace with the actual web addresses …
Replace the above URLs and then copy all of your text file content to your clipboard when finished.
If you need help understanding basic HTML code, refer to this tutorial:
Go back to your Widgets section …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you want the button to display.
In the Available Widgets area, select the Text widget …
(WordPress text widget)
Drag the Text widget to your Active Widgets section and release it at the very top of the Widget Area …
(Drag-and-drop your Text widget)
Step 5 – Configure the widget.
Click on the widget title bar to configure its 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 your widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct URLs into the large text box, then click the save button …
Note: Make sure to check your contact page and button image links before pasting scripts into your Text Widget, or your button will not work.
*** If using WordPress version pre-4.8 ***
If 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 type in HTML code like we’re doing in this tutorial).
Here is some text added to a Text widget with Automatically add paragraphs box unchecked …
(Automatically add paragraphs option not checked)
Here is some text added to a Text widget with Automatically add paragraphs option checked …
(Automatically add paragraphs box checked)
***
Step 6 – Refresh your browser.
Once you have added the text widget and HTML content, go to your site and refresh your web browser. If you have entered all of the links correctly, then the clickable support button should display at the top of your sidebar menu …
(Clickable support button widget on blog sidebar)
The above screenshot shows a clickable button in the sidebar of a brand new WordPress site.
Step 7 – Test the widget.
The final step is to ensure that the clickable button works. Test this by clicking the button. You should be taken directly to the support page …
(Test your clickable button)
Tips:
If you would like the support 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. add the part containing target=”_blank” in the code):
When choosing images to add to your sidebar area, 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 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 image, then you may have to either adjust the size of your images, or the width of your sidebar column to make images display correctly on your sidebar.
(Adjust column width or reduce image size)
More Tips:
- If you don’t want your button image to be centered inside your sidebar, delete the <center> and </center> tags from the beginning and end of the line of code. The image will then be aligned to its default settings (normally left-aligned).
- Link your help button to any URL you like (e.g. to an external link, contact form, support forum, etc.) and change this anytime by editing the code in your text widget.
***
This is the end of section 2 of this tutorial about how to use WordPress widgets.
To view the rest of this tutorial, click here:
***
"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group