In Part One of this tutorial, we explained the basics of using WordPress widgets.
In this section you will learn how to configure various WordPress widgets.
Configuring Sidebar Widgets
In a default WordPress installation, your site comes with several preinstalled 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, filter posts by categories, news items, add site search features, etc.
(By default, your site comes with a number of preinstalled widgets)
Configuring Widgets On The Sidebar Menu: Step-By-Step Tutorial
In this tutorial, we are going to add, configure and reorder various frequently-used WordPress widgets, including:
- Add a Help graphic button linking visitors to the contact details page.
- Adding a Categories section.
- Add a Recent Posts section to display your latest posts.
- Add a list of the site’s main Pages.
- Display important Links on your sidebar.
- Display the latest news using an RSS Feed section.
- Add tag links with a Tag Cloud section.
- Add and configure an Archives section to the sidebar section.
To access the Widgets section log into your WP admin and go to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets section in your browser …
(Widgets Panel)
Let’s start configuring some sidebar menu widgets …
Adding Text Widgets To Your Blog Sidebar
Text widgets are incredibly 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)
Text widgets can be used to add article snippets, images, reviews and more to your site … simply by typing in text or adding HTML into the widget content area. You can also add an optional title in the Title field. Remember to save your settings …
(A text widget is extremely versatile!)
Example: Add A Clickable Help Button To The Sidebar Navigation Menu Using A Text Widget
For this example, we’ll set up a support button on the sidebar 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 will want visitors to click on …
We’ll set up the clickable button to display at the top of your sidebar like in the example shown below …
Step 1 – Upload your image.
Upload the button image to your server’s images folder and note the address of your image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
This information will be required in Step 3.
In order for someone to go to the contact page when the graphic 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 – Create the destination page.
Create a contact page on your site 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. In simple terms, we just need to create the instructions linking the graphic image to your contact page/helpdesk.
Your code can be typed into a simple text file 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 screenshot below shows the sections of the above sample code that you will need to replace with your actual contact details …
Replace the above URLs and then copy all of the above code to your clipboard when finished.
If you need help understanding basic HTML code, see this tutorial:
Next, go back to your Widgets section …
(Widgets Screen)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where your button should display.
In the Available Widgets area, find the Text widget …
(WordPress text widget)
Drag the Text widget to your Active Widgets section and release it at the top of the Widget Area …
(Drag-and-drop your Text widget)
Step 5 – Configure the widget settings.
Click on the Text widget title bar to configure its settings. Paste the code with the URLs to your contact page and graphic button into the text widget content area and click the save button …
Add a title to your widget if you want (e.g. “Need Help?”, “Get Help”, etc.) and paste the code with the correct destination URLs into the Content area, then click Save when done …
Note: Remember to check your contact page and image URLs before pasting scripts into the Text Widget, or your 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 type in HTML content like we’re using in the example for this tutorial).
Here is some text with Automatically add paragraphs option not selected …
(Automatically add paragraphs option not ticked)
Here is some text added to a Text widget with Automatically add paragraphs box checked …
(Automatically add paragraphs option checked)
***
Step 6 – Refresh the browser.
After adding your widget and formatted content, visit the front-end of your site and refresh your web browser. If all links have been entered correctly, then your support button will display at the top of your site’s sidebar menu …
(Clickable button widget on blog sidebar)
The screenshot above shows the contact button added to a newly-installed WordPress site.
Step 7 – Test your button.
The last step is to make sure that your clickable button works. Test the button to make sure that visitors will go to your help page when they click on the graphic image. If you are taken to your support page, then your text widget has been set up correctly …
(Test the clickable button)
Tips:
If you want the contact page to display in a new window when visitors click on the support (so they don’t leave the page they’re on), then change the text widget code from this:
To this (i.e. include the part containing target=”_blank” in the text widget code):
When inserting images into your sidebar section, make sure that the width of the image doesn’t 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 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 graphic size, or the column width to make graphics display correctly on your theme.
(Adjust column width or reduce image size)
More Tips:
- If you don’t want your 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 the help button to any destination you like (e.g. to an external site, helpdesk, support forum, etc.) and change this anytime by editing the links inside the text widget.
***
This is the end of part two of this tutorial series on how to use WordPress widgets.
To view the rest of this tutorial, click this link:
***
"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)