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 WidgetsIn Part One of this tutorial, we explained the basics of using widgets in WordPress.

In this tutorial you will learn how to configure several widgets in WordPress.

Sidebar Widget Configuration

By default, your site comes with several 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 pages, filter posts by categories, text or HTML banners, filter content by publish dates, etc.

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

(In a default WordPress installation, your site comes with several preinstalled widgets)

Adding Sidebar Widgets In WordPress: Step-By-Step Tutorial

In this tutorial, we are going to add, configure and reorder s number of widgets, including:

  • Add a Contact Us button linking to your support page.
  • Adding a Categories section.
  • Add a Recent Posts section.
  • Adding a list of the site’s Pages.
  • Display useful Links on your sidebar navigation section.
  • Displaying news items using an RSS Feed section.
  • Add a Tag Cloud.
  • Add and configure an Archives section to the sidebar section.

The Widgets area is located in your WP administration area and can be easily accessed from the dashboard menu by choosing Appearance > Widgets

Understanding WordPress For Newbies: About WordPress Widgets

(WordPress Widgets Menu)

This loads the Widgets screen in your browser …

Widgets Screen

(Widgets Area)

Let’s configure WordPress text widgets …

Adding Text Widgets To Your Sidebar Section

Text widgets are versatile …

WordPress Text widget

(WordPress 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 your sidebar or other widget sections, such as lists of favorite items, images, news and updates and more to your site … simply by typing in text or pasting HTML into the widget content area. You can also give the widget a title. Remember to save your settings when done …

A text widget is really useful

(Text widgets are very useful!)

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

For this example, let’s set up a clickable support button on the sidebar menu 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, create or source a graphic image that your visitors can click on …

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

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

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

Step 1 – Upload your image.

To display the image on your site, first you must upload the button image to your server and note down the path to your image location.

For example …

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

You will use this information in Step 3.

In order for someone to be taken to the contact page when the graphic button gets clicked, either create a contact page, or have an existing destination page already set up (e.g. a helpdesk). We will link the button image to this URL in Step 3

Step 2 – Create your contact page.

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

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

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 image.

Your instructions can be typed in a plain text file and should look something like this …

Add A Clickable Help Button To Your 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 with the URL of your image location.

The screenshot below shows the sections of the above sample code that you need to replace with the actual web addresses …

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

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:

Now, go back into your Widgets area …

Activate or deactivate widgets using drag & drop

(Widgets Screen)

Step 4 – Add a Text widget.

Add a Text widget to your sidebar where you want the button to display.

In the Available Widgets area, find the Text widget …

WordPress text widget

(Text widget)

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

Dragging and dropping your Text widget

(Dragging and dropping your Text widget)

Step 5 – Configure your widget.

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

Text widget

Add a heading to the widget if you want (e.g. “Need Help?”, “Get Support”, etc.) and paste the code with the correct destination links into the large text box, then click the save button …

Text widget

Info

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

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

If you’re adding text without 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 paste in HTML content like we’re doing in this tutorial).

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

Automatically add paragraphs box not ticked

(Automatically add paragraphs option not ticked)

Here is some text with Automatically add paragraphs box checked …

Automatically add paragraphs box checked

(Automatically add paragraphs option selected)

***

Step 6 – Refresh the 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 the support button should display at the top of your sidebar menu …

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

(Clickable button widget on sidebar)

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

Step 7 – Test your widget.

The final step is to make sure that the destination URL works. Test this by clicking on the graphic button. You should be taken to your support page …

Test your text widget

(Test the text widget)

Useful Tip

Tips:

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

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

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

Using A Text Widget To Add A Help Button To Your Sidebar Section - open in new window

When choosing images for 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 can display different column widths depending on their templates and layout. Some sidebars are wide and some are narrow. If your theme’s sidebar 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 the images display correctly on your sidebar.

Adjust column width or reduce image size

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

More Tips:

  • If you don’t want to center your image inside 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 support button to any URL you want (e.g. to an external site, helpdesk, forum, etc.) and change this anytime by replacing the links inside the text widget.

Using Widgets

***

This is the end of part 2 of this series of tutorials.

Click on this link to continue:

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org