Untitled UI logotext
Solutions
WebsitesEcommerceMobile AppsWeb AppsProduction Support & Maintenance
Our work
Company
About usBlogPodcastContact us
Book a free consultation

How to Hide a Wordpress Sidebar From Pages

Olivia Rhye

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;
}

Ready to start a project?

Book a free consultation
Untitled UI logotext
Our work
About us
Blog
Careers
Submit a ticket
Agency Partnerships
Contact
© 2024 fjorge. All rights reserved.
Privacy