How to Edit Sidebar In WordPress

how to edit sidebar wordpressThere are several ways to edit sidebar in WordPress, you can use the widgets options, theme options, customizer and directly edit the code. Each of these ways to edit sidebar in WordPress depends on the active theme on your WordPress site. The majority of WordPress themes will either have a theme option way to edit sidebar or support customizer option to edit sidebar.

In this tutorial, I want to highlight each of these ways that you can use to edit sidebar in WordPress highlighting the pros and cons of each of these methods. If you are looking for the best way to edit sidebar in WordPress blog or site, this post should be the best place to get you started.

What is a Sidebar?

It helps to begin by answering this question since the sidebar may have different definitions for different users.

Basically sidebar in WordPress context is an area on your website that is reserved for additional content that is different from the main content. By design, most WordPress sidebars are located either left or right side. In WordPress, you can also have a sidebar located below the content area.

Common Sidebar Layouts

The layout of the sidebar can vary from one theme to another but the standard layouts that are popular across all themes include:

  • Left sidebar layout
  • Right Sidebar layout
  • Both left and right sidebar layouts

Another important thing about the sidebar in WordPress is the ability to add content to the sidebar using widgets that are easy to use since they are drag-and-drop blocks.

How to Create Sidebar in WordPress?

Sidebar in WordPress is created by either a WordPress theme or a plugin. The code to add sidebar in WordPress is added to the functions.php file and consists of a sidebar registration function and some arguments that are used to register the WordPress sidebar.

If you are interested in learning more about how to create sidebar in WordPress, I wrote a comprehensive guide here – how to add sidebar in WordPress and another one – how to register sidebar in WordPress and how to remove the sidebar in WordPress.

The following is the simplest code that you can add to functions.php file to add a custom sidebar to your WordPress site:

function my_custom_sidebar() {

    register_sidebar(

        array (

            'name' => __( 'Custom', 'your-theme-domain' ),

            'id' => 'custom-side-bar',

            'description' => __( 'Custom Sidebar', 'your-theme-domain' ),

            'before_widget' => '<div class="widget-content">',

            'after_widget' => "</div>",

            'before_title' => '<h3 class="widget-title">',

            'after_title' => '</h3>',

        )

    );

}

add_action( 'widgets_init', 'my_custom_sidebar' );

The following is the code that you can use to display the custom sidebar you added in the step above:

<?php if ( is_active_sidebar( 'custom-side-bar' ) ) : ?>   

          <?php dynamic_sidebar( 'custom-side-bar' ); ?>

<?php endif; ?>

You can use it in a page template or other theme files like header or footer where you want to display the WordPress sidebar. Since we have highlighted the basic information about WordPress sidebar, let us look at the ways to edit sidebar in WordPress.

#1) Edit Sidebar in WordPress Using Widgets

The widget options in WordPress theme allows you to add new features to the WordPress sidebar using drag and drop. These small blocks that you can add by drag and drop method are referred to as WordPress widgets.

There are thousands of widgets that you can use to enhance the features of your WordPress sidebar. These widgets may come with a theme or they can be added by a WordPress plugin. You can also create your own custom widgets to accomplish specific needs.

You can also search the web or WordPress repository for free or premium widget plugins that allow you to add specific functionality to your WordPress sidebar. Most of these plugins just create a widget that automatically becomes available on your widgets section when you activate the plugin.

There are several types of widget plugins that you can add to the WordPress sidebar. The following is a list of the most common widget WordPress plugins that you can add to the WordPress sidebar:

  • Social Media widget plugins
  • Login and registration widget plugins
  • Popular posts and recent post widget plugins
  • Shortcodes widget plugins
  • Media gallery and video widget plugins
  • Author widget plugins
  • Search widget plugin
  • Ecommerce widget plugins
  • Ads management widget plugins
  • Custom code widget plugins

There are also default widgets that come with WordPress and they play an important role when you want to add common features on your WordPress sidebar.

Example Edit WordPress Sidebar by Adding Social Icons

If you want to add social icons on your WordPress sidebar the simplest way to add social media icons is to use the widget option. The following are the steps you should take:

  1. Look for a good social media icons widget plugin
  2. Install and activate the social media icons plugin
  3. Go to Appearance Menu > Widget section and drag the specific social media plugin widget to the sidebar for it to appear.
  4. Configure the settings like adding your social media links and save the settings.

Let me follow through with a practical example by adding one of the best sidebar social media widget plugins.

Search for Best Social Media Widget Plugin

The first step in editing the WordPress sidebar to add the social media icons is to get the best social media icons plugin.

I will use this plugin called Simple Social Icons that is free and you can download it from the WordPress repository or you can install it directly on your WordPress plugins dashboard page.

Install and Activate the Social Media Widget Plugin

Download and upload the plugin to the plugin directory or install directly in the dashboard page as shown in the image above.how to edit sidebar wordpress

When you install click on the activate button and the plugin will be activated and the social media widget will be available to add to the sidebar.

Add Social Media Icon Widget to Sidebar

To add the social media widget to the sidebar you simply need to drag and drop the widget to the sidebar as illustrated on the image below:how to edit sidebar wordpress

When you drag it there you can now open it using the down arrow to begin the configuration of the way the widget will appear on the sidebar.

Configure the Settings and Save Changes

You can configure the settings as shown below the color settings links and many different settings that vary from one sidebar widget plugin to another.how to edit sidebar wordpress

After you save the changes visit the frontend to view the changes on the sidebar and you will have made your first successful edit to WordPress sidebar.

You can now see the front side the social icons will be displayed as shown on the image below:

#2) Edit WordPress Sidebar by Theme Options

The second way you can edit WordPress sidebar is by using the theme option. This is a common way to edit sidebar in WordPress for premium themes.

You need to check if your currently installed WordPress theme has options to edit the sidebar from the theme options.

The theme options in most cases allow users to set the layout display of the sidebar as well as add custom widgets and code.

#3) Edit WordPress Sidebar by Customizer

The third way to edit the sidebar in WordPress is by using the default theme customizer. The customizer may offer you the option to add the widgets as shown below:how to edit sidebar wordpress

You can also have an option to set the layout of the sidebar as is the case in the WooCoomerce default theme –Storefront.edit sidebar in wordpress

#4) Edit WordPress Sidebar by Code

This is the fourth way to edit WordPress sidebar that may include several custom options that range from creating multiple custom sidebars to adding sidebar or removing sidebar in WordPress or removing sidebar in the WooCommerce product page.

Conclusion

In this article, we have outlined all the possible ways of editing WordPress sidebar ranging from the simplest to the most advanced. This should be the best guide to get you started with editing the WordPress sidebar.

Comments are closed.