In Part 1 of this tutorial, we cover the basics of how to use widgets in WordPress.
In this section you are going to learn how to begin configuring several WordPress widgets.
How To Configure Sidebar Widgets
In a default WordPress installation, your site comes with several preinstalled widgets that can be used out of the box with minimal to no configuration needed, such as widgets that let you display external links, filter posts by categories, newsfeeds, adding search features, etc.
(In a default WordPress installation, your site comes with a number of built-in widgets)
Adding And Configuring Widgets On Your Sidebar: Tutorial
In this tutorial series, you are going to add, configure and reorder a number of commonly-used WordPress widgets, including:
- Add a clickable Help button linking visitors to the contact details page.
- Add a Categories section.
- Adding a Recent Posts section to display your latest posts.
- Adding a list of Pages.
- Display a list of useful Links on your sidebar navigation menu.
- Adding an RSS Feed section.
- Add a list of clickable tags through a Tag Cloud section.
- Configure how Archived Posts display on the sidebar navigation section.
The Widgets area can be accessed inside the admin by going to Appearance > Widgets …
(Widgets Menu)
This brings up the Widgets panel in your browser window …
(Widgets Section)
Let’s begin to configure some widgets …
Add A Text Widget To Your Blog 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)
A text widget lets you insert just about anything you want into the sidebar or other widget sections, such as instructions, images, reviews and more to your site … simply by typing in text or inserting HTML into the content area. You can also add an optional title in the Title field. Remember to save your settings …
(Text widgets are versatile!)
Example: Using A Text Widget To Add A Support Button To Your Sidebar Menu
For this example, let’s set up a clickable help button on your sidebar navigation section 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 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 the clickable image on your site, first you must upload the button image to a folder on your server and note down the address of your server’s image location.
E.g. …
http://www.yourdomain.com/images/supportbutton.jpg
You will use this information in Step 3.
In order for someone to go to your contact page when they click on the graphic button, 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 – Add the destination page.
Create a contact page on your site and note the page URL …
Step 3 – Create the HTML code for your text widget.
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 instructions 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 with the URL of your image location.
The image below shows the sections of the above sample code that you will need to replace with the actual contact details …
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:
Now, go back to your Widgets panel …
(Widgets Panel)
Step 4 – Add a Text widget.
Add a Text widget to your sidebar in the location where your button should display.
In the Available Widgets area, find a Text widget …
(WordPress text widget)
Drag your Text widget to the Active Widgets section and release the widget at the top of the Widget Area …
(Drag-and-drop your Text widget)
Step 5 – Configure the widget.
Click on the widget title bar to configure its 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 to the widget if you want (e.g. “Need Help?”, “Get Support”, etc.) and paste the code with the correct destination links into the Content box, then click the save button …
Note: Remember to check all URLs before pasting scripts into the Text Widget, or the button will not 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: not required 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 box not checked …
(Automatically add paragraphs box unchecked)
Here is some text with Automatically add paragraphs option ticked …
(Automatically add paragraphs box selected)
***
Step 6 – Refresh your browser.
Once you have added your text widget and content, go to the front-end of your site and refresh the web browser. If all links have been entered correctly, then the clickable support button should display in the sidebar menu …
(Clickable button widget on blog sidebar)
The screenshot above shows the support contact button in the sidebar navigation menu of a newly-installed WordPress site.
Step 7 – Test the button.
The last step is to ensure that the links work. Test the button to make sure that your visitors will go to the support page when they click on the graphic image. You should be taken directly to your contact page …
(Test your text widget)
Useful Tips:
If you want a new browser window to open up when visitors click on the support button (so they don’t leave the page they’re on), then change the text widget code from this:
To this (i.e. add the part containing target=”_blank” in your code):
When inserting images into your sidebar navigation section, make sure that the width of your image does not exceed the width of your sidebar column, especially if you are using a non-responsive WordPress theme. As we’ve previously explained, some themes can display different column widths depending on their templates and their layout. Some sidebars are wide and some are narrow. If your theme’s sidebar width is narrower than the width of the button images, then you may have to either adjust the size of your images, or the column width to make graphics display correctly on your sidebar area.
(Adjust column width or reduce image size)
Additional Tips:
- If you don’t want to center the button image inside 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).
- You can link the help button to any URL you want (e.g. to an external link, contact form, forum, etc.) and change this anytime by editing the content inside your text widget.
***
This is the end of part two of this tutorial series.
Click here to continue:
***
"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now