Thursday, 23 November 2017

How to remove sidebar and get a full-width layout in WordPress


In this tutorial we will show how easy it is to remove a sidebar from any page or post and get a full-width layout. This method will work in all modern, well-coded WordPress themes using only the best plugin to hide sidebars! No coding. No custom templates. Does My Theme Support Hidden Sidebars?
If you have a modern WordPress theme, it should automatically support full-width layouts when hiding sidebars. To understand how WordPress themes handle and display widget areas, we need to look at two basic functions you might’ve come across if you have ever looked at the code in your theme:
is_active_sidebar(‘name’) – checks if a specific widget area is active or not
dynamic_sidebar(‘name’) – displays a specific widget area
But what is an active sidebar? In general, a sidebar that contain widgets is active, while an empty sidebar is inactive. The 3 most common cases for how WordPress themes handle inactive sidebars are:
Sidebar is completely removed, and a full-width layout takes up its space (Standard in modern, well-coded themes)
Sidebar is hidden, but a blank space takes its place
Sidebar is hidden, but hardcoded widgets take its place (Used to be the norm in the early
Source: https://managewp.org/articles/16695/how-to-remove-sidebar-and-get-a-full-width-layout-in-wordpress




source https://williechiu40.wordpress.com/2017/11/23/how-to-remove-sidebar-and-get-a-full-width-layout-in-wordpress/

No comments:

Post a Comment