Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Created January 6, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thecodepoetry/3d419f04fbcae9b4c73e to your computer and use it in GitHub Desktop.
Save thecodepoetry/3d419f04fbcae9b4c73e to your computer and use it in GitHub Desktop.
Disable sidebar globally
add_action( 'get_header', 'dt_disable_sidebar', 10 );
function dt_disable_sidebar() {
$config = Presscore_Config::get_instance();
$config->set( 'sidebar_position', 'disabled' );
}
@thecodepoetry
Copy link
Author

Use this code in your child theme functions.php

@thecxguy
Copy link

I didn't need this disabled globally, just on one type of page. Unfortunately I was unable to just use a conditional with it due to the way the plugin and theme were interacting. After digging around for awhile, I figured out how to use this info to solve my problem.

In my child theme, I duplicated the page template file and named it "page-events" I added $config->set( 'sidebar_position', 'disabled' ); just after presscore_config_base_init();. I told my plugin to use this page template and my sidebar problem was solved.

Thanks for getting me pointed in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment