In Part One of this tutorial, we cover the basics of how to use widgets in WordPress.
In this section you will configure a number of WordPress sidebar widgets.
Configuring Widgets
In a default WordPress installation, your site comes with several preinstalled widgets, such as widgets that let you display links to your site’s pages, filter posts by categories, text or HTML banners, filter content by tags, etc.
(In a default WordPress installation, your site comes with a number of pre-installed widgets)
Configuring Frequently-Used Widgets On The WordPress Sidebar: Tutorial
In this step-by-step tutorial, you will add, configure and reorder various WordPress widgets, including:
- Add a Support graphic linking visitors to the help page.
- Add a Categories section.
- Add a Recent Posts section to display your latest posts.
- Adding a list of your site’s main Pages.
- Display important Links on the sidebar.
- Add an RSS Feed section.
- Adding a list of clickable tags using a Tag Cloud.
- Add and configure an Archives section to your sidebar.
The Widgets panel can be accessed inside the WordPress dashboard by going to Appearance > Widgets …
(WordPress Widgets Menu)
This loads the Widgets section in your browser …
(Widgets Screen)
Let’s configure WordPress text widgets …
Adding Text Widgets
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 can be used to add quotes, image links, forms and more to your site … just type in text or add HTML into the content area. You can also give the widget a title. Remember to save your settings when done …
(Text widgets are versatile!)
Example: Use A Text Widget To Add A Help Button To Your Sidebar Section
For this example, let’s set up a clickable contact 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 the clickable Help button to display at the top of your sidebar like in the example shown below …
Step 1 – Upload your image.
To display the clickable image on your site, the button image must be uploaded to your server. Upload your button graphic to the images folder in your server and note down the URL pointing to your image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
You will need this information in Step 3.
In order for visitors to go to your contact page when they click on the graphic button, you will need to either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will link the button graphic to this URL in Step 3 …
Step 2 – Add the destination page.
Create a contact page and note down its 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 instructions can be written a plain text file 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 above with the URL of your image location.
The screenshot below shows which sections of the above code you will need to replace with your 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 understanding basic HTML code, see this tutorial:
Go back to your Widgets section …
(Widgets Area)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar where you would like your button to display.
In the Available Widgets area, find the Text widget …
(Text widget)
Drag the Text widget to the Active Widgets section and release the widget at the top of the Widget Area …
(Dragging and dropping your WordPress text widget)
Step 5 – Configure the widget.
Click on the 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 heading 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 the save button …
Note: Remember to test your contact page and button image URLs before pasting scripts into the Text Widget, or your clickable button won’t work.
*** If using WordPress version pre-4.8 ***
If you’re adding text with no formatting tags like paragraph breaks, 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 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 selected …
(Automatically add paragraphs option not selected)
Here is some text with Automatically add paragraphs box selected …
(Automatically add paragraphs box ticked)
***
Step 6 – Refresh the web browser.
Once you have added your widget and HTML content, go to your site and refresh your web browser. If all links have been entered correctly, then the clickable support button should display at the top of the sidebar menu …
(Clickable support button widget on sidebar)
The screenshot above shows a clickable button added to a brand new WordPress site.
Step 7 – Test the widget.
The final step is to make sure that your links work. Test this by clicking on the button. If you are taken to your contact page, then everything has been set up correctly …
(Test the clickable button to make sure it works)
Tips:
If you would like your support page to display in a new browser window when visitors click on the support (so they don’t leave the page they’re on), then change the text widget code from this:
To this (i.e. include the section that says: target=”_blank” in the code):
When inserting images into your sidebar navigation section, make sure that the width of the image doesn’t 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 their layout. Some sidebars may be wider or narrower. If your theme’s sidebar is narrower than the width of the graphic image, then you may need to either adjust the graphic size, or the width of your sidebar column to make graphics display correctly on your sidebar.
(Make sure the width of the image does not exceed the width of the sidebar column)
Additional Tips:
- If you don’t want to center your image in your sidebar, delete the <center> and </center> tags from the beginning and end of the line of code. The image will then align to the left.
- You can link the contact button to any URL you want (e.g. to an external link, contact form, support forum, etc.) and change this anytime by replacing the code inside your widget.
***
This is the end of section 2 of this tutorial series on how to use Widgets.
To view Part Three, click this link:
***
"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