You must be able to resize your template if you want to create a good website. By default, many themes offer awkward template skeletal dimensions. Narrow topics are just as bad as too broad. You must have a “sweet spot” that is just right for performing the functions on the site. Only in this way the content of your resource will be displayed correctly, and all the widgets will fit into the sidebar. In this article, you will learn what are the ways to adjust the size of the side columns.
Without a sidebar, the site looks useless. If you want to somehow visually dilute the content of the page, you should change the WordPress template by adding a sidebar of a certain size. It usually has sidebars already installed by default. But the width of the sidebar is not always optimal for a particular project. Let's take a look at the methods of how to change the width and height of the side part of a WordPress site.
What should be the size of the sidebar
You may not need to change anything. Change the sidebar only if it looks “crooked” and unnatural. First, make sure the sidebar is narrower than the main body of the page containing the content. The sidebar is not a key part of the site, so it shouldn't be paid much attention to - at most it can occupy 40% of the visible part of the page. Please note that if you have two (or more) sidebars, their width should not exceed 50% of the entire page width. It is better to use only one side column - it is more efficient this way.
There is a “golden rule” of designers for sites that use only one sidebar. This rule states that if there is only one sidebar on a page, it should not occupy more than 38% of the site's width. Many eminent web designers speak about such a mysterious figure (for example: Jarel Remik).
As for the height, it is important that the sidebar does not stick out from the top of the site. Its height in the upper limit should be the same as the main body of the page. But the lower limit can be changed to make the base part of the site longer. There is no need to try to cram everything that is on the site into the sidebar - only the basic. And if there is really a lot of information, then make two side columns, but you do not need to stretch the sidebar to the footer of the site.
How to resize the sidebar manually
Now let's talk about how to independently resize the sidebars and the template framework itself without using any extras. This method involves changing source code pages. It is in the html tags that the template size parameter is enclosed. Please note that resizing can have negative consequences if you have uploaded a custom sized image as the background. Therefore, it is better to change the parameters of the wireframe at the stage of the site layout.
Sidebar parameters in the code are in the form of a block. To change the size of the entire frame, including the side columns, you need to dig into the code and alternately adjust the digital parameters of the width and height of each element. Namely:
- header - is responsible for the size of the site header;
- bg is the main content, that is, the part of the page on which the articles will be posted (this is the part where the sidebar is located);
- footer is the footer of the site, that is, its footer.
To find out the dimensions of a specific block, you need to click on the wrapper item in the “View page code”. On the side, in the CSS section of the browser, you will see the numeric values for the width of the element in pixels. To resize the entire wireframe, you need to edit the main element, and then make changes to other elements. It is recommended to do this on local server so that your site does not "jump" in front of users. And, in general, it is better to do this even before the launch of an Internet project.
To resize the sidebar, find a line like this
This line is responsible for the parameters of the middle part of the page, that is, for the content block and for the side columns. Don't touch the “main” line - this is the main part of the site. You need to find the tag “mainnav” - this is the sidebar. All you need to do is change the width item in the CSS - enter a different size value. You can shrink or enlarge the sidebar, but remember to follow the dimensioning tips above to ensure your site displays correctly.
In order for the changes made to be saved, they must be made on the server. That is, you can initially test the adjustments on local hosting, but then be sure to copy the edited style.css file and add it to the databases of the main server. Only then will the changes take effect.
Sidebar resizing plugin
If you don't want to wade into the insides of cascading style sheets and look for elements that need to be edited, then you can use the Visual Sidebar Editor for WordPress plugin. This is a special module designed to generate side speakers. It is part of the more global Visual Composer tool.
The Visual Composer plugin is a natural page builder for WordPress. With it, you can create a ready-made template from scratch. The module works with shortcodes and is very easy to install. If resizing the sidebar isn't the only thing you need to do, download the Visual Composer plugin and add the Visual Sidebar Editor as an add-on. If the problem is only with the size of the sidebar of the page, then the Visual Sidebar Editor module will suffice.
The advantage of using a plugin to change the sidebar is that it does everything automatically. That is, you show what you want to change using the Drag & Drop system, and the module independently adjusts the element code based on your requests. If you want to try your hand at editing html tags, then the plugin will provide you with such an opportunity. In addition, it has special shortcodes for making additional functions to the site - more than 40 extensions.
Another plus of using such a plugin for editing pages is saving changes, regardless of the engine version. Even if you update WordPress, the template will not change - it is controlled by the module. Therefore, you can upgrade to older versions or update WordPress - this will not do any harm to the dimension of the sidebar. In addition, the plugin works with convenient import and export - that is, you can copy sidebars from one site and move them to others. And, most importantly, the module works according to an extremely understandable principle - even a beginner will quickly master it.
If you enjoy the work of the Visual Sidebar Editor, consider installing the complete add-on - the Visual Composer module. Then it will be easy for you to edit any element on the portal pages.
It often happens that a theme you like has a narrow area for entries and its settings do not provide for changing the width. In this case, it can be increased, with minimal knowledge Html and CSS... For example, let's use the popular, free Patagonia theme. You can expand the theme with the help of a wonderful plugin Firefox— Firebug... First you need to install it by downloading it from here. Then turn on plugin, as it shown on the picture - Tools tab — Web development — Firebug — open Firebug:
After that, at the bottom of the screen, it is necessary to select various elements by hovering the cursor and clicking with the mouse. In this case, on the right side, will be displayed CSS styles, and in the area of the page, this or that area will be highlighted - the main one, sidebar, header... We are now interested in the main area that we will get to when we "enter" the tag For example, increase the width main area from 550 pixels to 620 pixels. To do this, you need to make changes to the line width: 550px file style.css... If the theme is already installed, you can edit this file directly from the admin panel, if not, then you need to unpack the archive with the theme and make changes to the file using the editor. In our case, the theme is installed, so go to admin panel— Appearance — Editor- open the style.css file, find the line width: 550px and change the width value 550px to 620px. We press Update file. We go to the site and see that the area of posts has expanded, but in some places "ran over" to the right column. In this case, we need to proportionally narrow this area. For this, we also use Firebug plugin as in the previous case. Find the tag