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

In this section you are going to learn how to begin configuring several WordPress sidebar widgets.

Widget Configuration

In a default WordPress installation, your site comes with several built-in active widgets, such as widgets for displaying links to your site’s pages, filter posts by categories, RSS feed content, adding tag clouds, etc.

By default, your site comes with several pre-installed widgets

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

How To Add Sidebar Widgets In WordPress: Tutorial

In this tutorial series, you will learn how to add, configure and reorder s number of widgets, including:

  • Adding a Support Contact graphic linking to the contact page.
  • Adding a Categories section.
  • Add a Recent Posts section.
  • Add a list of the site’s Pages.
  • Display useful Links on the sidebar.
  • Display newsfeeds with an RSS Feed section.
  • Add tags to your sidebar using a Tag Cloud section.
  • Adding and configuring an Archives section to your sidebar navigation menu.

The Widgets panel is located in the WP dashboard and can be accessed by going to Appearance > Widgets

Understanding WordPress For Newbies: About WordPress Widgets

(WordPress Widgets Menu)

This brings up the Widgets screen in your browser …

Widgets Screen

(Widgets Panel)

Let’s begin to configure your sidebar widgets …

Text Widgets

Text widgets are quite useful …

Text widget

(WordPress Text widget)

Useful Information

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 or other widget sections, such as single lines or paragraphs of text, images, messages and more to your site … just type in text or paste HTML into the widget content area. You can also add an optional title in the Title field. Remember to save your settings …

Text widgets are versatile

(Text widgets are versatile!)

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

For this example, we’ll set up a clickable support button on your 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, create or source a “help button” graphic image that your visitors can click on …

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

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

Add A Support Button To Your Sidebar Menu 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 your button graphic to a folder on your server and note the address of your image location.

E.g. …

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

You will need this information in Step 3.

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

Step 2 – Add your contact page.

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

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

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

Your code can be written a simple text editor and will look something like this …

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

  • 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 which sections of the above code you need to replace with the actual web addresses …

Add A Clickable Support Button To Your Sidebar Menu Using A Text Widget

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

If you need help understanding basic HTML code, see this tutorial:

Now, go back to your Widgets screen …

Activate or deactivate widgets using drag-and-drop

(Widgets Panel)

Step 4 – Add a Text widget.

Add a Text widget to your sidebar where you would like the clickable button to display.

In the Available Widgets area, select the Text widget …

Text widget

(WordPress text widget)

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

Drag and drop your Text widget

(Dragging and dropping your Text widget)

Step 5 – Configure the widget.

Click on the 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 save …

WordPress text widget

Add a title section to the widget if you want (e.g. “Need Help?”, “Support”, etc.) and paste the code with the correct destination URLs into the text area, then click the save button …

Text widget

Important Info

Note: Make sure to check all URLs before pasting scripts into the Text Widget, or your button won’t 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: this is not necessary if you’re typing in formatted 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 option not ticked …

Automatically add paragraphs option unchecked

(Automatically add paragraphs box not selected)

Here is some text with Automatically add paragraphs option selected …

Automatically add paragraphs option ticked

(Automatically add paragraphs option checked)

***

Step 6 – Refresh your browser.

After adding your text widget and HTML code, visit the front-end of your site and refresh your web browser. If you have entered all of the links correctly, then the clickable support button should display at the top of your sidebar menu …

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

(Clickable button widget on blog sidebar)

The above screenshot shows ’click for help’ button in the sidebar of a brand new WordPress site.

Step 7 – Test the widget.

The final step is to ensure that your links work. Test this by clicking the button. If you are taken directly to the support page, then the text widget has been set up correctly …

Test your clickable button to make sure you've set up everything correctly

(Test your text widget to make sure it works)

Practical Tip

Useful Tips:

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

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

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

Add A Contact Button To The Sidebar Menu Using A Text Widget - open in new window

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. As we’ve previously mentioned, 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 your graphic image, then you may need to either adjust the size of your images, or the width of your sidebar column to make images display correctly on your sidebar section.

Adjust column width or reduce image size

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

More Tips:

  • If you don’t want to center the button inside your sidebar, delete the <center> and </center> tags from the beginning and end of the line of code. The image will then be aligned to its default settings (normally left-aligned).
  • You can link your support button to any destination you like (e.g. to an external link, helpdesk, forum, etc.) and change this anytime by editing the code in your widget.

How To Use Widgets In WordPress

***

This is the end of section 2 of this tutorial series.

Click on this link to view the rest of this tutorial:

***

"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