In Part One of this step-by-step tutorial series, we cover the basics of using WordPress widgets.
In this section you are going to learn how to begin configuring a number of WordPress widgets.
Configuring Sidebar Widgets
In a default WordPress installation, your site comes with several preinstalled active widgets, such as widgets that let you display links to your pages, recent posts, RSS feed content, adding search features, etc.
(In a default WordPress installation, your site comes with a number of built-in widgets)
Configuring Frequently-Used WordPress Sidebar Widgets: Step-By-Step Tutorial
In this tutorial, you will add, configure and reorder various widgets to display in the site’s sidebar, including:
- Adding a clickable Support image linking visitors to the contact details page.
- Adding a Categories section.
- Add a Recent Posts section to display the latest posts.
- Adding a list of your site’s main Pages.
- Display useful Links on the sidebar navigation section.
- Displaying the latest news using an RSS Feed section.
- Add tags to your sidebar area using a Tag Cloud.
- Adding and configuring an Archives section to your sidebar.
To access the Widgets area go to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets section in your browser …
(Widgets Screen)
Let’s get started …
Add A Text Widget To Your Blog Sidebar Menu
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)
Text widgets let you insert just about anything you want into the sidebar menu or other widget sections, such as article snippets, social media buttons, forms and more to your site … just type in text or add HTML into the widget content area. You can also give the widget a title. Remember to save your settings when done …
(A text widget is really useful!)
Example: Use A Text Widget To Add A Support Button To Your Sidebar Navigation Area
For this example, let’s set up a clickable help button on the 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 you will use on your own site …
We’ll set up a clickable Help button to display at the top of the sidebar like in the example shown below …
Step 1 – Upload your image.
To display the clickable button image on your site, you must first upload the button image to a folder on your server and note the path to your image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
You will use this information in Step 3.
For visitors to go to the contact page when the graphic button is clicked, you must either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will then link the button graphic to this URL in Step 3 …
Step 2 – Add a contact page.
Create a contact page and note down its URL …
Step 3 – Create 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 for your clickable image.
Your code can be composed 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 above with the URL of your image location.
The screenshot below shows which sections of the above sample code you need to replace with the actual contact page and image URLs …
Replace the above URLs and then copy all of your text file content to your clipboard when finished.
If you need help figuring out basic HTML code, refer to this tutorial:
Now, go back into your Widgets panel …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where your clickable button should display.
In the Available Widgets area, select the Text widget …
(WordPress 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 Text widget)
Step 5 – Configure the widget settings.
Click on the widget title bar to configure the widget 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?”, “Get Support”, etc.) and paste the code with the correct destination URLs into the Content box, then click Save when done …
Note: Make sure to check your contact page and image links before pasting scripts into your Text Widget, or the clickable 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 an HTML paragraph code (note: not required if you’re pasting in formatted 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 box selected)
***
Step 6 – Refresh your browser.
After adding the widget and HTML content, go to the front end of your site and refresh your browser. If all links have been entered correctly, then the support button should display in your site’s sidebar menu …
(Clickable support button widget on sidebar)
The screenshot above shows ’click for help’ button added to a brand new WordPress site.
Step 7 – Test the widget.
The last step is to ensure that the links work. Test this by clicking the button. You should be taken directly to the contact page …
(Test your clickable button to ensure it works)
Tips:
If you want a new window to open up when visitors go to your support page (so they don’t leave the page they’re in), then change the button code from this:
To this (i.e. insert the section containing target=”_blank” in your text widget code):
When adding images to your sidebar menu, 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. Note that some themes can display different column widths depending on their templates and layout. Some sidebars may be wider or narrower. If your theme’s sidebar width is narrower than the width of the graphic image, then you may need to either adjust the size of your images, or the width of your sidebar column to make the images display correctly on your sidebar.
(Adjust column width or reduce image size)
Extra Tips:
- If you don’t want your image to be centered in your sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then be left-aligned.
- You can link your help button to any URL you like (e.g. to an external site, contact form, support forum, etc.) and change this anytime by replacing the code in the widget.
***
This is the end of part two of this series of tutorials on how to use WordPress widgets.
Click here to continue reading:
***
"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