Remove sidebar defaults
This commit is contained in:
@@ -5,19 +5,6 @@ namespace App;
|
||||
use Roots\Sage\Template;
|
||||
use Roots\Sage\Template\Wrapper;
|
||||
|
||||
/**
|
||||
* Determine which pages should NOT display the sidebar
|
||||
* @link https://codex.wordpress.org/Conditional_Tags
|
||||
*/
|
||||
add_filter('sage/display_sidebar', function ($display) {
|
||||
// The sidebar will NOT be displayed if ANY of the following return true
|
||||
return $display ? !in_array(true, [
|
||||
is_404(),
|
||||
is_front_page(),
|
||||
is_page_template('templates/template-custom.php'),
|
||||
]) : $display;
|
||||
});
|
||||
|
||||
/**
|
||||
* Add <body> classes
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ function asset_path($filename)
|
||||
function display_sidebar()
|
||||
{
|
||||
static $display;
|
||||
isset($display) || $display = apply_filters('sage/display_sidebar', true);
|
||||
isset($display) || $display = apply_filters('sage/display_sidebar', false);
|
||||
return $display;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user