Learn how to create and customize a sidebar in WordPress in a simple way – WAU

Sidebar in WordPress is the term used to define an area of ​​the page that has the function of displaying complementary content. Check out different ways to create, customize and optimize the sidebar.

The term Sidebar at the WordPress is used to refer to an area of ​​the theme that has the purpose of presenting content that serves as a complement to the main content. It is not mandatory, but this space can be used in several ways, including to improve the page ranking.

In most themes, the sidebar is already created by default and just configure the widgets that will be inserted in it. However, there may be a need to use it differently from the original. So it is important to understand how to perform this process in a simple way.

In this post, we will show:

Want to know how to customize the sidebar? Read on!

What is sidebar in WordPress?

The sidebar, which means “sidebar” in London, is an area in the page layout used to add content other than the main one. It is possible to use it in different positions and formats.

That is, it can be positioned on the sides, at the top or at the bottom of the page and can be displayed horizontally or vertically.

In addition, it is possible to have more than one sidebar on the same page and in the same position. This means that we can place two bars in the right side position, for example, or divide the footer into three sidebars. Therefore, it is an extremely versatile resource that offers numerous possibilities for use.

Its function is make the layout more organized and facilitate the distribution of content in different positions on the page. The themes available in WordPress already come with some configured sidebars, just drag the desired widgets for each one.

It is worth mentioning that widgets are small blocks that allow you to perform specific functions, for example: list the latest articles published on the site, display a calendar and more. It is, therefore, the content that will be inserted in the sidebar.

The configuration of the sidebar depends a lot on the theme used, as there are options that are highly configurable. In others, it is necessary to do this manually or through plugins to meet the needs of the site. In this scenario, it is called dynamic sidebar or dynamic sidebar.

Why use sidebar in WordPress?

The possibilities for using sidebars are the most varied. Meantime, care must be taken not to overdo and use more than necessary. Check out the main types of content used in the sidebar.

View social networks

They are used, for example, to display social media publications. This way, the visitor has a view of what happens on the networks and can enjoy the page or interact with the posts.

Sign up for the newsletter

Another way of using the resource is to display a form to subscribe to the website’s newsletter. That way, users who like the content can easily find the place to inform the email to receive news from the page.

View posts

The sidebar is also useful for displaying the latest posts published by the site. They can be classified in different ways, such as by date of publication, by month or year, by subject or tags. The ideal is to study what is the most sought after by the users of the site and offer the resource according to this need.

Display advertising

It is common in a blog to use the sidebar to display banners or advertisements for companies and products. Directing these ads to the sidebar helps to make the page cleaner and more organized, rather than displaying advertisements in popups, which cause irritation to visitors.

Care must be taken with the use of advertisements on the page. When displaying many ads, one must take be careful not to turn the sidebar into the exit door for users of the site.

How to create a sidebar?

There are different ways to configure the website sidebar. We will show some of them below.

Default WordPress theme option

If the theme already has the desired configuration, just select the alternative “Appearance”> “Widgets” in the WordPress Dashboard. In this model, the Twenty Seventeen theme was used, which is available with the CMS installation package.

To add a new widget in the sidebar, simply select an alternative from the available widgets. Click and drag the selected item to the desired position.

Dynamic sidebar

Another way to create the sidebar is dynamically, that is, manual configuration is made so that the bar is available as needed. If the template used is developed by a third party, it is recommended that changes are made to a child theme.

The child theme allows changes made to continue to work if the original template is updated by the developerbecause your files are not changed when there is any change to the parent theme. Therefore, whenever a template is customized, it is important to follow this direction.

There are plugins that help to create the child theme or you can create it manually. Another important observation is about the structure of the theme. In WordPress, the templates must have some specific files to follow the development pattern and guarantee its functioning.

One of them is “functions.php”. It is a file with some settings about how the theme works, including the setting the size of the avatar image, O registration of navigation menus it’s the sidebar record. To customize the sidebar, you will need to edit this file.

To do this, go to “Appearance”> “Theme editor” and select “functions.php” in “Theme functions file”.

Then, insert the following code in the text, changing the “name-of-your-theme” to the name of the respective main theme used and press the “Update file” button.

function minha_sidebar() {
  array (
      'name' => __( 'Custom', 'nome-do-seu-tema-pai'),
      'id' => 'minha-side-bar',
      'description' => __( 'Custom Sidebar', 'nome-do-seu-tema-pai' ),
      'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

, ) ); } add_action( 'widgets_init', 'minha_sidebar' );

To use the sidebar, go to “Appearance”> “Widgets”. You will see that there is a new container with the “Custom” description corresponding to the created sidebar.

Now, just add the desired widgets to the created sidebar.

To use the sidebar, choose which file you want to include the sidebar in and add the following command:

There is also the alternative of inserting this other code in the “sidebar.php” file.

In addition, it is possible to edit the “style.css” file to add custom styles to the sidebar, as well as define its placement on the page.

How to customize your sidebar?

It is possible to customize the sidebar through a plugin. There are several free options on WordPress.org. For this example, we will use the Custom-sidebars plugin. After downloading and installing the plugin, go to “Appearance”> “Widgets” in the WordPress Dashboard.

To create a new bar, click on the “Create new sidebar” button.

Fill in the name and description for the sidebar.

Next, choose which widgets will be placed in the sidebar.

Press the “Sidebar location” link to define where you want the sidebar to be displayed.

In this example, we select the “For Archives” option and choose the main page and the post page to display the bar. However, it is possible to choose among other display alternatives, such as displaying only for certain categories or according to a particular author of the post.

Ready! The bar will appear on the page without having to change any files on the site.

How to optimize sidebars for SEO?

Sidebars are excellent tools to be used in Digital Marketing strategies. This is because, if they are used correctly, they are able to help increase the traffic on the page and the number of conversions.

Some blogs and websites use this area to insert many widgets, which leaves the page loaded and can cause a bad impression to the user. When this happens, the result tends to be negative, as the user does not remain on the page, which contributes to the loss of audience on the site.

The best way to use the resource, therefore, is insert only widgets that are relevant to the content of the page and the company’s strategy. Check out some tips for its use.

Avoid redundancies

It is important to note that the widgets do not have very similar functions. For example, using widgets for all social networks is not a good alternative. Prefer to present only one and insert links to the other networks.

Customize sidebars per page or post

It is necessary to observe whether the content of the widgets is related to the content of the page. This is important to reinforce the site’s relevance. Therefore, make sure that on a given page it is necessary to display the list of the latest posts or try to display the posts related to the subject covered in the post.

Check speed and performance

Sidebars perform actions that can take a while to process. Therefore, it is important to remember that pages that take too long to load can damage the SEO strategy. Therefore, evaluate the performance of the page to make sure that the widgets do not hinder the speed of loading.

Another factor that can also interfere are the H1 and H2 header tags used on the page. Therefore, it is necessary to verify that there is no conflict between them. The best way to avoid problems is not to use these tags in widgets.

As we have seen, the best way to define the term sidebar WordPress it is like an area on the page intended for complementary content to the main one. There are several ways to use this space, however, attention is needed to turn this resource into an ally to improve the site’s ranking.

Since you are interested in this content, download our WordPress Guide for corporate blogs and see how to create excellent business opportunities with this tool!