In Part 1 of this step-by-step tutorial, we cover the basics of how to use WordPress widgets.
In this tutorial you will learn how to begin configuring a number of widgets in WordPress.
Configuring Sidebar Widgets
By default, your site comes with several built-in active widgets, such as widgets that let you display links to your site’s pages, recent posts, newsfeeds, adding tag clouds, etc.
(By default, your site comes with a number of built-in widgets)
Adding Sidebar Widgets To WordPress: Tutorial
In this tutorial series, we will add, configure and reorder s number of widgets, including:
- Add a clickable Support button linking visitors to your help page.
- Adding a Categories section with a drop down menu.
- Adding a Recent Posts section to display the latest posts.
- Adding a list of your site’s main Pages.
- Display important Links on your sidebar area.
- Adding an RSS Feed section.
- Adding a Tag Cloud.
- Add and configure an Archives section to your sidebar.
The Widgets screen is located in your WordPress administration area and can be easily accessed by going to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets section in your browser …
(Widgets Screen)
Let’s start by learning how to configure WordPress text widgets …
Adding Text Widgets To Your Sidebar
Text widgets are versatile …
(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)
Text widgets let you insert just about anything you want into your sidebar or other widget sections, such as quotes, images, scripts and more to your site … simply by typing in text or pasting HTML into the widget content area. You can also add an optional title in the Title field. Remember to save your settings …
(Text widgets are extremely versatile!)
Example: Add A Clickable Help Button To The Sidebar Navigation Section Using A Text Widget
For this example, we’ll set up a contact button on the sidebar 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, you will need to 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 section like in the example shown below …
Step 1 – Upload your image.
To display the image on your site, first you must upload the graphic image to your server and note the URL pointing to your server’s image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will use this information in Step 3.
For someone to go to your contact page when they click on the graphic button, you must either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will link your button image to this URL in Step 3 …
Step 2 – Add your contact page.
Create a contact page and note down its URL …
Step 3 – Create the code for your text widget.
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 code can be typed in a plain 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 image below shows which sections of the above sample code you need to replace with the actual web addresses …
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 into your Widgets section …
(Widgets Screen)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you want your clickable button to display.
In the Available Widgets area, find a Text widget …
(Text widget)
Drag your Text widget to your Active Widgets section and release it at the very top of the Widget Area …
(Dragging and dropping your Text widget)
Step 5 – Configure the text widget settings.
Click on the widget title bar to configure the widget settings. Paste the code with the links to your contact page and graphic button into the text widget content area and click the save button …
Add a title section to your widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct destination URLs into the Content area, then click Save when done …
Note: Make sure to test your contact page and button image links before pasting scripts into your Text Widget, or the clickable 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 an HTML paragraph code (note: not required if you’re typing in formatted HTML content 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 unchecked)
Here is some text with Automatically add paragraphs option checked …
(Automatically add paragraphs box selected)
***
Step 6 – Refresh your browser.
After adding your text widget and code, visit your site and refresh your web browser. If all links have been entered correctly, then the clickable support button should display in the site’s sidebar menu …
(Clickable button widget on blog sidebar)
The above screenshot shows the button in the sidebar of a newly-installed WordPress site.
Step 7 – Test the widget.
The last step is to make sure that the destination URL works. Test your button to make sure that your visitors will go to the contact page when they click on the button. You should be taken directly to the support page …
(Test the text widget to make sure you’ve set everything up correctly)
Text Widgets – Useful Tips:
If you would like a new window to open up when visitors go to the support page (so they don’t leave the page they’re in), then change the button code from this:
To this (i.e. add the section containing target=”_blank” in your text widget code):
When choosing images for 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 their layout. Some sidebars may be too wide or too 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 column width to make images display correctly on your sidebar area.
(Make sure that the image width does not exceed the sidebar column width)
Additional Tips:
- If you don’t want to center your button 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 the help button to any destination you want (e.g. to an external site, helpdesk, FAQ page, etc.) and change this anytime by editing the content inside your text widget.
***
This is the end of section two of this tutorial on how to use WordPress widgets.
Click on this link to access the rest of this tutorial series:
***
"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com