How To Use And Configure WordPress Widgets – Part 2

Learn how to add, configure, and use text widgets on your WordPress sidebar …

How To Add And Configure Widgets In Your WordPress SidebarIn Part 1 of this tutorial, we explained the basics of how to use widgets in WordPress.

In this tutorial you will learn how to configure a number of widgets in WordPress.

Configuring Sidebar Widgets

In a default WordPress installation, your site comes with a number of preinstalled widgets that can be used out of the box with minimal to no configuration required, such as widgets that let you display links to your site’s pages, recent posts, newsfeeds, filter content by tags, etc.

By default, your site comes with several built-in widgets

(By default, your site comes with a number of active widgets)

Adding Widgets To The WordPress Sidebar Area: Step-By-Step Tutorial

In this tutorial, we will add, configure and reorder various widgets, including:

  • Adding a Contact Us button linking to your contact page.
  • Add a Categories section.
  • Add a Recent Posts section to display the latest posts.
  • Adding a list of Pages.
  • Display a list of useful Links on your sidebar.
  • Displaying the latest news with an RSS Feed section.
  • Add a Tag Cloud section.
  • Configure how your Archived Posts display on the sidebar.

To access the Widgets panel log into the WP dashboard and go to Appearance > Widgets

Understanding WordPress For Newbies: About WordPress Widgets

(Widgets Menu)

This brings up the Widgets screen in your browser …

Widgets Section

(Widgets Area)

Let’s begin by learning how to configure WordPress text widgets …

Text Widgets

Text widgets are versatile …

Text widget

(Text widget)

Info

Rich Text Widget

From version 4.8 onward, WordPress has added native rich-text editing capabilities to text widgets …

Rich Text Widget

(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 area or other widget sections, such as email and contact information, images, tips and more to your site … simply by typing in text or pasting HTML into the content area. You can also add an optional title in the Title field. Remember to save your settings …

Text widgets are really versatile

(A text widget is really useful!)

Example: Use A Text Widget To Add A Clickable Help Button To The Sidebar Navigation Area

For this example, we’ll set up a clickable support 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 …

Add A Clickable Help Button To Your Sidebar Navigation Area Using A Text Widget

We’ll set up the clickable button to display at the top of your sidebar like in the example shown below …

Add A Clickable Contact Button To The Sidebar Area Using A Text Widget

Step 1 – Upload your image.

To display an image on your site, the image must be uploaded to your server. Upload the image to a folder on your server and note down the address of your image location.

E.g. …

http://www.yourdomain.com/images/supportbutton.jpg

You will need this information in Step 3.

For visitors to be taken to the contact page when the help 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 – Create the support page.

Create a contact page on your site and note its URL …

Add A Support Button To Your Sidebar Navigation Area Using A Text Widget

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 graphic image to the contact page/helpdesk.

Your instructions can be typed into a plain text editor and should look something like this …

Use A Text Widget To Add A Clickable Help Button To Your Sidebar Area

  • 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 image below shows the sections of the above code that you need to replace with your actual contact details …

Use A Text Widget To Add A Help Button To Your Sidebar Area

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 to your Widgets area …

Activate or deactivate widgets using drag-and-drop

(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 a Text widget …

WordPress text widget

(Text widget)

Drag your Text widget to your Active Widgets section and release it at the very top of the Widget Area

Drag and drop your Text widget

(Dragging and dropping your Text widget)

Step 5 – Configure your widget.

Click on the Text widget title bar to configure its settings. Paste the code with the URLs to your contact page and graphic button into your text widget content area and click the save button …

Text widget

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 box, then click the save button …

WordPress text widget

Important

Note: Make sure to check your contact page and image links before pasting scripts into the Text Widget, or your clickable button will not work.

*** If using WordPress version pre-4.8 ***

If 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 an HTML paragraph code (note: not required if you’re typing in code like we’re doing in this tutorial).

Here is some text with Automatically add paragraphs box not checked …

Automatically add paragraphs box unchecked

(Automatically add paragraphs option not checked)

Here is some text added to a Text widget with Automatically add paragraphs box selected …

Automatically add paragraphs box checked

(Automatically add paragraphs option checked)

***

Step 6 – Refresh the browser.

Once you have added your widget and HTML content, go to your site and refresh your web browser. If you have entered all of the links correctly, then your clickable support button should display at the top of your site’s sidebar menu …

Add A Clickable Help Button To Your Sidebar Navigation Section Using A Text Widget

(Clickable button widget on blog sidebar)

The above screenshot shows the button added to a brand new WordPress site.

Step 7 – Test the widget.

The last step is to make sure that the destination link works. Test this by clicking on the button. If you are taken directly to the contact page, then the text widget has been set up correctly …

Test the clickable button to make sure it works

(Test the clickable button to make sure it works)

Useful Tip

Useful Tips:

If you would like a new browser window to open up when visitors click on your support button (so they don’t leave the page they’re in), then change the text widget code from this:

Using A Text Widget To Add A Help Button To The Sidebar Navigation Area

To this (i.e. include the part that says: target=”_blank” in the html code):

Add A Clickable Support Button To Your Sidebar Menu Using A Text Widget - open in new window

When choosing images for your sidebar navigation menu, make sure that the width of the image does not exceed the width of your sidebar column, especially if you are using a non-responsive WordPress theme. As mentioned earlier, some themes can display elements differently 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 button images, then you may have to either adjust the size of your images, or the column width to make images display correctly on your sidebar section.

Adjust column width or reduce image size

(Make sure the width of the image does not exceed the width of the sidebar column)

Extra Tips:

  • If you don’t want to center your image in the sidebar, delete the <center> and </center> tags from the beginning and end of the code. The image will then align to the left.
  • You can link your help button to any URL you want (e.g. to an external site, helpdesk, FAQ page, etc.) and change this anytime by editing the code in your widget.

Using Widgets In WordPress

***

This is the end of part 2 of this series of tutorials about how to use WordPress widgets.

To view the rest of this tutorial series, click here:

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum