How To Use And Configure WordPress Widgets – Part 2

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

How To Use Widgets In WordPressIn Part 1 of this tutorial series, we explained the basics of using widgets in WordPress.

In this tutorial you are going to begin configuring various sidebar widgets in WordPress.

How To Configure 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, filter posts by categories, news items, adding tag clouds, etc.

By default, your site comes with a number of pre-installed widgets

(In a default WordPress installation, your site comes with several built-in widgets)

How To Add Sidebar Widgets In WordPress: Tutorial

In this tutorial, you will learn how to add, configure and reorder various WordPress widgets, including:

  • Add a Contact Us graphic button linking to your help page.
  • Add a Categories section with a drop down menu.
  • Add a Recent Posts section to display the latest posts.
  • Add a list of the site’s Pages.
  • Display useful Links on your sidebar.
  • Add an RSS Feed section.
  • Adding tags to the sidebar navigation area with a Tag Cloud section.
  • Add and configure an Archives section to your sidebar navigation menu.

The Widgets area can be accessed inside the administration by going to Appearance > Widgets

Understanding WordPress For Newbies: About WordPress Widgets

(WordPress Widgets Menu)

This opens the Widgets screen into your browser window …

Widgets Panel

(Widgets Panel)

Let’s get started …

Add A Text Widget To The Blog Sidebar Section

Text widgets are incredibly versatile …

WordPress 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)

A text widget lets you insert just about anything you want into your sidebar or other widget sections, such as article snippets, ads, messages and more to your site … just type in text or insert HTML into the content area. You can also give the widget a title. Remember to save your settings …

Text widgets are really useful

(Text widgets are very useful!)

Example: Add A Support Button To The Sidebar Navigation Section Using A Text Widget

For this example, we’ll set up a help button on the sidebar 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 visitors can click on …

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

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

Use A Text Widget To Add A Clickable Help Button To The Sidebar Navigation Section

Step 1 – Upload your image.

To display the clickable image on your site, the image must be uploaded to your server. Upload your image to a folder on your server and write down the path to your image location.

E.g. …

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

This information will be required in Step 3.

For visitors to go to the contact page when they click on the support button, you must 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 your contact page.

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

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

Step 3 – Compose 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, we just need to create the instructions for your clickable image.

Your code can be composed in a simple text file and should look something like this …

Add A Clickable Contact Button To The Sidebar Navigation Section Using A Text Widget

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

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

Replace the above URLs and then copy all of the above code to your clipboard when finished.

If you need help figuring out basic HTML code, refer to this tutorial:

Next, go back into your Widgets screen …

Activate or deactivate widgets using drag & drop

(Widgets Panel)

Step 4 – Add a Text widget.

Add a Text widget to your sidebar in the location where the support button should display.

In the Available Widgets area, select the Text widget …

Text widget

(Text widget)

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

Drag-and-drop your Text widget

(Drag and drop your WordPress text widget)

Step 5 – Configure your text 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 …

Text widget

Add a heading to the 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 …

Text widget

Important Info

Note: Make sure to test your contact page and button image links 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, 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 code like we’re using in the example for this tutorial).

Here is some text with Automatically add paragraphs option not selected …

Automatically add paragraphs option unchecked

(Automatically add paragraphs box unchecked)

Here is some text with Automatically add paragraphs option selected …

Automatically add paragraphs box ticked

(Automatically add paragraphs box ticked)

***

Step 6 – Refresh the browser.

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

Using A Text Widget To Add A Contact Button To The Sidebar Menu

(Clickable support button widget on sidebar)

The above screenshot shows the contact button in the sidebar navigation section of a newly-installed WordPress site.

Step 7 – Test your widget.

The final step is to ensure that your destination URL works. Test this by clicking on the button. If you are taken to your support page, then everything has been set up correctly …

Test the text widget

(Test your clickable button)

Useful Tip

Useful Tips:

If you want the support page to display inside a new window when visitors click on the help (so they don’t leave the page they’re on), then change the code from this:

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

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

Using A Text Widget To Add A Clickable Contact Button To Your Sidebar Area - open in new window

When adding images to your sidebar area, 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. Note that some themes can display elements differently depending on their templates and layout. Some sidebars may be wider or narrower. If the sidebar of your theme is narrower than the width of your button image, then you may have to either adjust the graphic size, or the column width to make images display correctly on your sidebar section.

Adjust column width or reduce image size

(Adjust column width or reduce image size)

More 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 align to the left.
  • You can link the contact button to any destination you want (e.g. to an external site, contact form, support forum, etc.) and change this anytime by editing the content in the widget.

Adding And Configuring WordPress Widgets In The Sidebar

***

This is the end of part two of this tutorial series about using Widgets.

To view Part 3, 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