© 2024 fjorge. All rights reserved.
How to Hide a Wordpress Sidebar From Pages
In combination with my previous post on adding multiple sidebars to a WordPress theme, I had the need to display one of them only when looking at the blog part of wordpress. This is pretty straightforward, but basically we just need to check if we are not on a page and display the sidebar.
//If we are viewing posts, not a page, print the posts sidebar
if(!is_page())
{
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Posts Sidebar') ):
endif;
}