Merge pull request #1760 from roots/remove-sidebar-defaults
Remove sidebar defaults
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
### HEAD
|
### HEAD
|
||||||
|
* Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760))
|
||||||
* Remove post formats ([#1759](https://github.com/roots/sage/pull/1759))
|
* Remove post formats ([#1759](https://github.com/roots/sage/pull/1759))
|
||||||
|
|
||||||
### 9.0.0-alpha.4: November 16th, 2016
|
### 9.0.0-alpha.4: November 16th, 2016
|
||||||
|
|||||||
@@ -5,19 +5,6 @@ namespace App;
|
|||||||
use Roots\Sage\Template;
|
use Roots\Sage\Template;
|
||||||
use Roots\Sage\Template\Wrapper;
|
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
|
* Add <body> classes
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function asset_path($filename)
|
|||||||
function display_sidebar()
|
function display_sidebar()
|
||||||
{
|
{
|
||||||
static $display;
|
static $display;
|
||||||
isset($display) || $display = apply_filters('sage/display_sidebar', true);
|
isset($display) || $display = apply_filters('sage/display_sidebar', false);
|
||||||
return $display;
|
return $display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user