In Part 1 of this tutorial series, we explained the basics of how to use WordPress widgets.
In this tutorial you will learn how to configure several widgets in WordPress.
Widget Configuration
By default, your site comes with several preinstalled active widgets, such as widgets for displaying external links, filter posts by categories, news items, adding content search features, etc.
(By default, your site comes with a number of built-in widgets)
Setting Up Sidebar Widgets: Tutorial
In this step-by-step tutorial series, you will learn how to add, configure and reorder various WordPress widgets to display in your site’s sidebar navigation menu, including:
- Add a Support graphic button linking to the support page.
- Add a Categories section.
- Adding a Recent Posts section.
- Add a list of Pages.
- Display useful Links on the sidebar navigation section.
- Add an RSS Feed section.
- Add a Tag Cloud section.
- Add and configure an Archives section to your sidebar.
The Widgets screen is located in the WordPress dashboard and can easily be accessed from the WordPress admin menu by choosing Appearance > Widgets …
(Widgets Menu)
This brings you to the Widgets section in your web browser …
(Widgets Screen)
Let’s configure a WordPress text widget …
Adding Text Widgets
Text widgets are quite 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 can be used to add events, maps and directions, tips and more to your site … just type in text or paste HTML into the widget content area. You can also give the widget a title. Remember to save your settings …
(A text widget is really versatile!)
Example: Use A Text Widget To Add A Support Button To Your Sidebar Navigation Area
For this example, let’s set up a support button on your 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, you will need to create or source a graphic image that you can use on your own site …
We’ll set up a clickable button to display at the top of the sidebar navigation section like in the example shown below …
Step 1 – Upload your image.
Upload the graphic image to your server and write down 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.
In order for someone to go to the contact page when they click on the support button, either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will then link your button graphic to this URL in Step 3 …
Step 2 – Create your destination 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. Basically, 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 with the URL of your image location.
The image below shows which sections of the above code you need to replace with the actual contact page and image URLs …
Replace the above URLs and then copy all of the above code to your clipboard when finished.
If you need help with basic HTML code, refer to this tutorial:
Now, 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 support button to display.
In the Available Widgets area, find the Text widget …
(WordPress text widget)
Drag your Text widget to the Active Widgets section and release it at the top of the Widget Area …
(Drag-and-drop your WordPress text widget)
Step 5 – Configure the widget.
Click on the Text widget title bar to configure its options. Paste the code with the URLs 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?”, “Get Support”, etc.) and paste the code with the correct URLs into the large text box, then click Save when done …
Note: Remember to test all links before pasting scripts into the Text Widget, or the button won’t work.
*** If using WordPress version pre-4.8 ***
If adding text with no formatting tags, you may want to tick the Automatically add paragraphs box to wrap each block of text in paragraphs (note: this is not necessary if you type 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 box not selected …
(Automatically add paragraphs box not checked)
Here is some text added to a Text widget with Automatically add paragraphs option ticked …
(Automatically add paragraphs option selected)
***
Step 6 – Refresh your web browser.
After adding the text widget and content, visit your site and refresh your web browser. If all links have been entered correctly, then the support button will display in your sidebar menu …
(Clickable button widget on sidebar)
The screenshot above shows ’click for help’ button in the sidebar menu of a newly-installed WordPress site.
Step 7 – Test your widget.
The final step is to ensure that your destination URL works. Test your button to make sure that visitors will go to your help page when they click on the graphic image. You should be taken to the support page …
(Test the clickable button to ensure you’ve set everything up correctly)
Text Widgets – Useful Tips:
If you want your contact page to open in a new browser window when visitors click on the help (so they don’t leave the page they’re on), then change the text widget code from this:
To this (i.e. add the section containing target=”_blank” in your text widget code):
When adding images to your sidebar navigation area, make sure that the width of your image does not exceed the width of the sidebar column, especially if you are using a non-responsive WordPress theme. As we’ve previously mentioned, some themes may 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 graphic images, then you may need to either adjust the image size, or the width of your sidebar column to make the images display correctly on your theme.
(Adjust column width or reduce image size)
More Tips:
- If you don’t want your image to be centered in the sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then be aligned to its default settings (normally left-aligned).
- You can link the contact button to any URL you like (e.g. to an external site, contact form, support forum, etc.) and change this anytime by replacing the links inside your text widget.
***
This is the end of section two of this tutorial.
Click on this link to keep reading:
***
"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie