In Part One of this step-by-step tutorial series, we cover the basics of using widgets in WordPress.
In this tutorial we are going to show you how to configure a number of WordPress widgets.
Widget Configuration
By default, your site comes with a number of built-in widgets, such as widgets that let you display links to your site’s pages, filter posts by categories, newsfeeds, adding tag clouds, etc.
(In a default WordPress installation, your site comes with a number of preinstalled widgets)
How To Configure Sidebar Widgets: Tutorial
In this step-by-step tutorial, you will learn how to add, configure and reorder a number of commonly-used WordPress widgets, including:
- Adding a clickable Contact Us image linking to your contact details page.
- Add a Categories section.
- Adding a Recent Posts section to display your latest posts.
- Add a list of the site’s most important Pages.
- Display important Links on your sidebar.
- Add an RSS Feed section.
- Add tag links using a Tag Cloud.
- Configure how your Archived Posts display on the sidebar navigation menu.
The Widgets area is located in the WP dashboard and can be easily accessed by going to Appearance > Widgets …
(WordPress Widgets Menu)
This loads the Widgets screen in your web browser …
(Widgets Area)
Let’s get started …
Text Widgets
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)
A text widget lets you insert just about anything you want into your sidebar or other widget sections, such as lists, images, forms and more to your site … simply by typing in text or adding HTML into the content area. You can also give the widget a title. Remember to save your settings when done …
(A text widget is very useful!)
Example: Add A Clickable Support Button To The Sidebar Navigation Section Using A Text Widget
For this example, let’s set up a clickable help button on the sidebar that takes 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, create or source a “help button” graphic image that you will want your 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.
To display the clickable image on your site, the image must be uploaded to your server. Upload the image to the images folder in your server and note down the address of your image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will need this information in Step 3.
For someone to go to the contact page when the support button gets 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 contact page.
Create a contact page and note its URL …
Step 3 – Create the HTML code for your text widget.
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 typed in a simple text file 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 screenshot below shows which sections of the above sample code you will need to replace with your actual web addresses …
Replace the above URLs and then copy 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 panel …
(Widgets Screen)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you would like the button to display.
In the Available Widgets area, find the Text widget …
(Text widget)
Drag your Text widget to your 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 Text widget title bar to configure the widget options. Paste the code with the links to your contact page and graphic button into your text widget content area and click save …
Add a heading to your widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct destination URLs into the large text box, then click the save button …
Note: Make sure to test all links before pasting scripts into the Text Widget, or your button won’t work.
*** If using WordPress version pre-4.8 ***
If 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 paste in formatted HTML content like we’re using in the example for this tutorial).
Here is some text with Automatically add paragraphs option unchecked …
(Automatically add paragraphs box unchecked)
Here is some text with Automatically add paragraphs box checked …
(Automatically add paragraphs option ticked)
***
Step 6 – Refresh your browser.
After adding your widget and HTML code, go to the front end of your site and refresh the browser. If all links have been entered correctly, then your support button will display at the top of your site’s sidebar menu …
(Clickable support button widget on blog sidebar)
The screenshot above shows the support contact button in the sidebar of a brand new WordPress site.
Step 7 – Test the widget.
The final step is to ensure that your destination link works. Test this by clicking on the help button. You should be taken directly to the contact page …
(Test the clickable button)
Text Widgets – Useful Tips:
If you want a new browser window to open up when visitors click on the help button (so they don’t leave the page they’re on), then change the text widget code from this:
To this (i.e. insert the section that says: target=”_blank” in the text widget code):
When inserting images into your sidebar menu, make sure that the width of your 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 elements differently depending on their templates and their layout. Some sidebars may be too wide or too narrow. 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 column width to make graphics display correctly on your sidebar.
(Make sure the width of the image does not exceed the width of the sidebar column)
Additional Tips:
- If you don’t want to center the image in your sidebar, delete the <center> and </center> tags from the beginning and end of the HTML code. The image will then be aligned to its default settings (normally left-aligned).
- Link your contact button to any URL you like (e.g. to an external site, contact form, FAQ page, etc.) and change this anytime by replacing the code inside the text widget.
***
This is the end of section 2 of this tutorial series.
Click here to view Part 3:
***
"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org