In Part 1 of this tutorial, we cover the basics of using widgets in WordPress.
In this tutorial you are going to learn how to begin configuring a number of widgets in WordPress.
Widget Configuration
By default, your site comes with several preinstalled 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, news items, add content search features, etc.
(In a default WordPress installation, your site comes with a number of built-in widgets)
How To Add And Configure Commonly-Used Widgets On Your Sidebar Navigation Area: Tutorial
In this tutorial, we will add, configure and reorder s number of WordPress widgets, including:
- Adding a clickable Help button linking to the contact page.
- Add a Categories section with a drop down menu.
- Adding a Recent Posts section to display the latest posts.
- Add a list of the site’s main Pages.
- Display useful Links on the sidebar.
- Adding an RSS Feed section.
- Adding clickable tags through a Tag Cloud.
- Configure how your Archived Posts display on the sidebar.
The Widgets screen is located in the WP admin area and can easily be accessed from the administration menu by choosing Appearance > Widgets …
(Widgets Menu)
This loads the Widgets section in your browser …
(Widgets Area)
Let’s start configuring some sidebar widgets …
Add A Text Widget
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 your sidebar or other widget sections, such as instructions, image links, forms and more to your site … just type in text or paste HTML into the content area. You can also add an optional title in the Title field. Remember to save your settings …
(Text widgets are very useful!)
Example: Add A Clickable Support Button To Your Sidebar Navigation Section Using A Text Widget
For this example, let’s set up a clickable contact button on your sidebar that will take 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 graphic image that your visitors can click on …
We’ll set up a clickable Help button to display at the top of the sidebar section 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 your button image to your server and note down the path to your image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
You will use this information in Step 3.
In order for someone to go to the contact page when the graphic button gets clicked, either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will link your button graphic to this URL in Step 3 …
Step 2 – Create a support page.
Create a contact page on your site and note its URL …
Step 3 – Compose your text widget code.
If you’re not a technical-minded person, don’t worry … this sounds a lot more technical than it is. In simple terms, you just need to create the instructions linking the button image to your contact page/helpdesk.
Your instructions can be typed in a simple text editor and will 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 will need to replace with the actual contact page and image URLs …
Replace the above URLs and then copy the above code to your clipboard when finished.
If you need help figuring out basic HTML code, refer to this tutorial:
Go back into your Widgets section …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where the support button should 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 top of the Widget Area …
(Drag-and-drop your Text widget)
Step 5 – Configure your text widget.
Click on the Text widget title bar to configure its options. Paste the code with the links to your contact page and graphic button into your text widget content area and click the save button …
Add a title to the widget if you want (e.g. “Need Help?”, “Get Support”, etc.) and paste the code with the correct destination links into the text area, then click the save button …
Note: Make sure to check all URLs before pasting scripts into your Text Widget, or the button will not work.
*** If using WordPress version pre-4.8 ***
If adding text without formatting tags, you may want to tick the Automatically add paragraphs box to wrap each block of text in an HTML paragraph code (note: this is not necessary if you’re typing in formatted content like we’re doing in this tutorial).
Here is some text added to a Text widget with Automatically add paragraphs box unchecked …
(Automatically add paragraphs option not ticked)
Here is some text with Automatically add paragraphs box selected …
(Automatically add paragraphs option checked)
***
Step 6 – Refresh the browser.
After adding the text widget and code content, visit your site and refresh your web browser. If you have entered all of the links correctly, then your support button will display at the top of the sidebar menu …
(Clickable button widget on blog sidebar)
The screenshot above shows the contact button in the sidebar menu of a brand new WordPress site.
Step 7 – Test your widget.
The final step is to ensure that your destination link works. Test this by clicking on the button. If you are taken directly to your support page, then everything has been set up correctly …
(Test your text widget)
Useful Tips:
If you want 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 button code from this:
To this (i.e. include the section that says: target=”_blank” in your text widget code):
When inserting images into 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 mentioned earlier, some themes may display different column widths depending on their templates and layout. Some sidebars may be too wide or too narrow. If your theme’s sidebar is narrower than the width of your button image, then you may have to either adjust the image size, or the width of your sidebar column to make images display correctly on your sidebar.
(Make sure that the width of the image does not exceed the width of the sidebar column)
More Tips:
- If you don’t want to center the 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).
- Link the contact button to any destination you want (e.g. to an external site, helpdesk, forum, etc.) and change this anytime by editing the content in your widget.
***
This is the end of part two of this series of tutorials.
Click on this link to access Part 3:
***
"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum