In Part 1 of this tutorial, we explained the basics of how to use WordPress widgets.
In this tutorial you will begin configuring various WordPress widgets.
Sidebar Widget Configuration
By default, your site comes with several built-in active widgets, such as widgets that let you display links to your pages, filter posts by categories, newsfeeds, filter content by publish dates, etc.
(By default, your site comes with a number of pre-installed widgets)
How To Add Sidebar Widgets To WordPress: Step-By-Step Tutorial
In this tutorial, you are going to add, configure and reorder various WordPress widgets, including:
- Add a Support image linking visitors to your contact page.
- Add a Categories section.
- Adding a Recent Posts section to display your latest posts.
- Adding a list of the site’s main Pages.
- Display a list of useful Links on your sidebar navigation area.
- Displaying newsfeeds with an RSS Feed section.
- Adding tag links through a Tag Cloud section.
- Adding and configuring an Archives section to the sidebar area.
The Widgets section is located in your WP admin area and can be accessed from the dashboard menu by choosing Appearance > Widgets …
(WordPress Widgets Menu)
This loads the Widgets panel into your browser …
(Widgets Section)
Let’s start by learning how to configure text widgets …
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)
Text widgets can be used to add quotes, maps and directions, forms and more to your site … just by typing in text or inserting 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: Use A Text Widget To Add A Clickable Contact Button To Your Sidebar Navigation Area
For this example, we’ll set up a clickable contact button on your sidebar navigation area 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, create or source a “help button” graphic image that visitors can click on …
We’ll set up a clickable button to display at the top of your sidebar like in the example shown below …
Step 1 – Upload your image.
To display the image on your site, the graphic image must be uploaded to your server. Upload the button image to your server and note the address of your image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
This information will be required in Step 3.
In order for visitors to go to the contact page when the support button gets clicked, you must 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 – Create your support page.
Create a contact page and note down its URL …
Step 3 – Compose 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. Basically, you just need to create the instructions for your clickable button.
Your instructions can be composed in a plain text file and should look something like this …
- Replace “http://www.yourdomain.com/contact-us” in the code 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 screenshot below shows the sections of the above sample code that you need to replace with the actual contact details …
Replace the above URLs and then copy the above code to your clipboard when finished.
If you need help understanding basic HTML code, refer to this tutorial:
Now, go back to your Widgets screen …
(Widgets Area)
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, select the Text widget …
(Text widget)
Drag your Text widget to the Active Widgets section and release the widget at the top of the Widget Area …
(Dragging and dropping your WordPress text widget)
Step 5 – Configure the text widget settings.
Click on the widget title bar to configure its settings. Paste the code with the links to your contact page and graphic button into the text widget content area and click save …
Add a title section to the widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct URLs into the Content area, then click the save button …
Note: Make sure to test your contact page and image URLs before pasting scripts into your Text Widget, or the button won’t work.
*** If using WordPress version pre-4.8 ***
If you’re adding text with no formatting tags, 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 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 option not checked …
(Automatically add paragraphs box not ticked)
Here is some text with Automatically add paragraphs box checked …
(Automatically add paragraphs option checked)
***
Step 6 – Refresh your web browser.
After adding the text widget and HTML content, go to the front end of your site and refresh the web browser. If all links have been entered correctly, then your clickable support button will display at the top of your site’s sidebar menu …
(Clickable button widget on blog sidebar)
The above screenshot shows the support button added to a brand new WordPress site.
Step 7 – Test your button.
The final step is to make sure that your clickable button works. Test the button to make sure that visitors will go to your contact page when clicking the graphic image. If you are taken directly to the support page, then the text widget has been set up correctly …
(Test your text widget)
Text Widgets – Useful Tips:
If you want your support page to display in a new window when visitors click on the support (so they don’t leave the page they’re in), then change the text widget code from this:
To this (i.e. add the part containing target=”_blank” in your text widget code):
When inserting images into your sidebar area, 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. Note that some themes may display elements differently depending on their templates and layout. Some sidebars are wide and some are narrow. If your theme’s sidebar is narrower than the width of the button image, then you may need to either adjust the size of your images, or the width of your sidebar column to make images display correctly on your sidebar section.
(Make sure the width of the image does not exceed the width of the sidebar column)
Additional Tips:
- If you don’t want the button to be centered inside your sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then be left-aligned.
- You can link the contact button to any destination you want (e.g. to an external link, helpdesk, support forum, etc.) and change this anytime by replacing the content inside the widget.
***
This is the end of section 2 of this tutorial about how to use Widgets.
To view Part 3, click here:
***
"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org