In Part One of this tutorial, we explained the basics of using widgets in WordPress.
In this section you will learn how to begin configuring various WordPress sidebar widgets.
How To Configure Widgets
In a default WordPress installation, your site comes with several built-in widgets that can be used out of the box with little to no configuration needed, such as widgets for displaying links to your site’s pages, recent posts, RSS feed content, filter content by tags, etc.
(By default, your site comes with a number of pre-installed widgets)
Configuring Sidebar Widgets: Step-By-Step Tutorial
In this tutorial, we will add, configure and reorder various frequently-used widgets to display in the site’s sidebar section, including:
- Adding a clickable Help graphic linking to your contact details page.
- Add a Categories section with a drop down menu.
- Add a Recent Posts section to display your latest posts.
- Adding a list of Pages.
- Display Links on your sidebar section.
- Display news items with an RSS Feed section.
- Adding a Tag Cloud section.
- Adding and configuring an Archives section to the sidebar area.
The Widgets panel is located inside your WP dashboard and can be accessed by going to Appearance > Widgets …
(Widgets Menu)
This opens the Widgets section into your web browser …
(Widgets Panel)
Let’s start to configure some sidebar menu widgets …
Add A Text Widget
Text widgets are 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 lets you insert just about anything you want into the sidebar area or other widget sections, such as quotes, image links, special promotions and more to your site … simply type in text or insert HTML into the content area. You can also give the widget a title. Remember to save your settings …
(Text widgets are really useful!)
Example: Add A Support Button To Your Sidebar Navigation Menu Using A Text Widget
For this example, we’ll set up a support button on the sidebar 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 a clickable button to display at the top of the sidebar like in the example shown below …
Step 1 – Upload your image.
To display the image on your site, the image must be uploaded to your server. Upload your image to a folder on your server and write down the URL pointing to your image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will need this information in Step 3.
For someone to be taken to your contact page when they click on the help button, 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 the support page.
Create a contact page and note down its URL …
Step 3 – Create your text widget code.
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 image.
Your instructions 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 above with the URL of your image location.
The image below shows the sections of the above sample code that you will need to replace with the actual web addresses …
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 into your Widgets screen …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where the button should display.
In the Available Widgets area, find the Text widget …
(WordPress text widget)
Drag your Text widget to your Active Widgets section and release it at the top of the Widget Area …
(Drag-and-drop your WordPress text widget)
Step 5 – Configure your widget settings.
Click on the Text widget title bar to configure the widget options. 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 Support”, etc.) and paste the code with the correct URLs into the large text box, then click the save button …
Note: Make sure to test all links before pasting scripts into your Text Widget, or your button won’t work.
*** If using WordPress version pre-4.8 ***
If you’re adding text without 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 code like we’re doing in this tutorial).
Here is some text with Automatically add paragraphs option not ticked …
(Automatically add paragraphs option unchecked)
Here is some text added to a Text widget with Automatically add paragraphs option selected …
(Automatically add paragraphs box selected)
***
Step 6 – Refresh your browser.
Once you have added your widget and HTML content, visit your site and refresh the browser. If all links have been entered correctly, then the clickable support button will display at the top of the sidebar menu …
(Clickable button widget on sidebar)
The above screenshot shows the support button in the sidebar of a newly-installed WordPress site.
Step 7 – Test the button.
The last step is to make sure that the links work. Test this by clicking the button. You should be taken to your support page …
(Test your clickable button to ensure you’ve set up everything correctly)
Useful Tips:
If you would like a new window to open up when visitors click on your help button (so they don’t leave the page they’re in), then change the text widget code from this:
To this (i.e. add the section containing target=”_blank” in your html code):
When choosing images to add to your sidebar menu, 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. As mentioned earlier, some themes may 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 graphic size, or the width of your sidebar column to make elements display correctly on your theme.
(Adjust column width or reduce image size)
Additional Tips:
- If you don’t want to center the button inside the sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then align to the left.
- You can link your contact button to any destination you want (e.g. to an external site, helpdesk, 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 series.
To view Part Three, click this link:
***
"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com