In Part One of this step-by-step tutorial, we explained the basics of using widgets in WordPress.
In this tutorial you are going to learn how to configure various WordPress sidebar widgets.
How To Configure Commonly-Used WordPress Widgets
By default, your site comes with a number of pre-installed widgets, such as widgets for displaying links to your site’s pages, recent posts, text or HTML banners, add a search box, etc.
(In a default WordPress installation, your site comes with a number of preinstalled widgets)
How To Configure Sidebar Widgets In WordPress In WordPress: Tutorial
In this step-by-step tutorial, you will add, configure and reorder various commonly-used widgets to display in the site’s sidebar navigation menu, including:
- Add a Support Contact graphic linking visitors to the support page.
- Adding a Categories section.
- Adding a Recent Posts section.
- Adding a list of the site’s main Pages.
- Display important Links on the sidebar navigation section.
- Add an RSS Feed section.
- Add a Tag Cloud section.
- Configure how Archived Posts display on your sidebar area.
The Widgets screen is located inside the WP administration area and can be easily accessed by going to Appearance > Widgets …
(Widgets Menu)
This loads the Widgets panel in your browser …
(Widgets Screen)
Let’s begin by configuring text widgets …
Add A Text Widget To Your Sidebar
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)
A text widget lets you insert just about anything you want into the sidebar or other widget sections, such as email and contact information, image links, messages and more to your site … just by typing in text or adding HTML into the content area. You can also give the widget a title. Remember to save your settings …
(A text widget is extremely versatile!)
Example: Add A Support Button To Your Sidebar Menu Using A Text Widget
For this example, we’ll set up a contact button on the sidebar section 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 graphic image that your visitors can click on …
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.
Upload the image to your server and write down the address of your server’s image location.
For example …
http://www.yourdomain.com/images/supportbutton.jpg
You will use this information in Step 3.
In order for visitors to be taken to the contact page when they click on the help 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 then link your button graphic to this URL in Step 3 …
Step 2 – Add a destination page.
Create a contact page on your site and note down its URL …
Step 3 – Create 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 linking your button image to your contact page.
Your code can be typed in a simple text editor 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 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 web addresses …
Replace the above URLs and then copy all of the above code to your clipboard when finished.
If you need help with basic HTML code, refer to this tutorial:
Go back into your Widgets screen …
(Widgets Area)
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, select the Text widget …
(WordPress text widget)
Drag the Text widget to the Active Widgets section and release it at the very top of the Widget Area …
(Dragging and dropping your WordPress text widget)
Step 5 – Configure the text widget settings.
Click on the widget title bar to configure its options. Paste the code with the links to your contact page and graphic button into the text widget content area and click save …
Add a heading to your widget if you want (e.g. “Need Help?”, “Get Help”, etc.) and paste the code with the correct destination URLs into the Content box, then click Save when done …
Note: Make sure to test your contact page and image links before pasting scripts into your Text Widget, or the button won’t 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 added to a Text widget with Automatically add paragraphs box not ticked …
(Automatically add paragraphs box not checked)
Here is some text with Automatically add paragraphs option selected …
(Automatically add paragraphs option ticked)
***
Step 6 – Refresh your web browser.
Once you have added your widget and HTML content, go to the front end of your site and refresh your web browser. If all links have been entered correctly, then your support button will display in the sidebar menu …
(Clickable button widget on blog sidebar)
The screenshot above shows the support button in the sidebar of a newly-installed WordPress site.
Step 7 – Test your button.
The final step is to make sure that your destination link works. Test your button to make sure that visitors will go to the contact page when they click on the button. You should be taken directly to the contact page …
(Test your clickable button to make sure you’ve set up everything correctly)
Text Widgets – Useful Tips:
If you would like your contact page to open inside a new window when visitors click on the support (so they don’t leave the page they’re in), then change the button code from this:
To this (i.e. insert the section that says: target=”_blank” in your html code):
When choosing images to add to your sidebar section, 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 layout. Some sidebars may be too wide or too narrow. If the sidebar of your theme is narrower than the width of the button images, then you may need to either adjust the size of your images, or the width of your sidebar column to make elements display correctly on your theme.
(Adjust column width or reduce image size)
Additional Tips:
- If you don’t want your button image to be centered inside the 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 destination you like (e.g. to an external site, contact form, FAQ page, etc.) and change this anytime by replacing the code in your text widget.
***
This is the end of part two of this tutorial series on using WordPress widgets.
Click here to continue:
***
"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com