In Part One of this step-by-step tutorial, we explained the basics of using widgets in WordPress.
In this section you will learn how to configure several widgets in WordPress.
How To Configure Sidebar Widgets
In a default WordPress installation, your site comes with a number of 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, adding tag clouds, etc.
(In a default WordPress installation, your site comes with several built-in widgets)
Adding And Configuring Widgets On The WordPress Sidebar Navigation Area: Tutorial
In this tutorial, we are going to add, configure and reorder a number of commonly-used widgets, including:
- Add a Support Contact graphic button linking visitors to your support page.
- Adding a Categories section with a drop down menu.
- Add a Recent Posts section to display the latest posts.
- Adding a list of your site’s main Pages.
- Display a list of useful Links on the sidebar.
- Displaying the latest news using an RSS Feed section.
- Add a Tag Cloud.
- Configure how your Archived Posts display on the sidebar.
The Widgets panel is located inside your WordPress administration area and can be accessed by going to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets section in your web browser …
(Widgets Screen)
Let’s start to configure some widgets …
Adding Text Widgets To Your Blog Sidebar Area
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 let you insert just about anything you want into the sidebar or other widget sections, such as policies, image links, forms and more to your site … simply type in text or add HTML into the content area. You can also add an optional title in the Title field. Remember to save your settings when done …
(Text widgets are really versatile!)
Example: Add A Help Button To The Sidebar Navigation Menu Using A Text Widget
For this example, let’s set up a support button on your 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, create or source a 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 an image on your site, first you must upload the graphic image to the images folder in your server and note the path to your image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will need this information in Step 3.
In order for visitors to go to the contact page when the support button is clicked, you will need to 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 your contact page.
Create a contact page and note the page URL …
Step 3 – Compose your text widget code.
Don’t worry … this sounds a lot more technical than it is. In simple terms, you just need to create the instructions for your clickable button.
Your code can be typed into a simple 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 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 understanding basic HTML code, see this tutorial:
Next, go back into your Widgets area …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you would like your support button to display.
In the Available Widgets area, select the Text widget …
(Text widget)
Drag the Text widget to your Active Widgets section and release the widget at the very top of the Widget Area …
(Drag and drop your WordPress text widget)
Step 5 – Configure the widget settings.
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 the text widget content area and click save …
Add a title to the widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct destination links into the text area, then click Save when done …
Note: Remember to test your contact page and image links before pasting scripts into the Text Widget, or your button will not 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 paragraphs (note: not required if you’re pasting in formatted HTML content like we’re doing in this tutorial).
Here is some text with Automatically add paragraphs option unchecked …
(Automatically add paragraphs option not ticked)
Here is some text added to a Text widget with Automatically add paragraphs option selected …
(Automatically add paragraphs box selected)
***
Step 6 – Refresh the browser.
After adding your text widget and HTML code, visit your site and refresh the web browser. If you have entered all of the links correctly, then your clickable support button should display in your sidebar menu …
(Clickable button widget on sidebar)
The above screenshot shows the contact button in the sidebar of a newly-installed WordPress site.
Step 7 – Test the widget.
The last step is to make sure that your destination link works. Test this by clicking on the button. If you are taken directly to your contact page, then your text widget has been set up correctly …
(Test your clickable button)
Useful Tips:
If you want your contact page to display in a new window when visitors click on the help (so they don’t leave the page they’re on), then change the code from this:
To this (i.e. include the section that says: target=”_blank” in your text widget code):
When choosing images for your sidebar navigation section, 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 explained, some themes can display elements differently 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 the button image, then you may have to either adjust the graphic size, or the width of your sidebar column to make graphics display correctly on your sidebar.
(Adjust column width or reduce image size)
Extra Tips:
- If you don’t want to center your button image inside the 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).
- You can link your support button to any destination you want (e.g. to an external site, helpdesk, support forum, etc.) and change this anytime by replacing the links in the widget.
***
This is the end of section two of this tutorial about how to use Widgets.
Click here to read the rest of this tutorial:
***
"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org