Last active
December 9, 2021 20:19
-
-
Save broskees/7c07e438699ff1f5db320084c219ba00 to your computer and use it in GitHub Desktop.
Sage 9 Conditional Sidebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('sage/display_sidebar', function ($display) { | |
static $display; | |
isset($display) || $display = in_array(true, [ | |
// The sidebar will be displayed if any of the following return true | |
is_single(), | |
is_404(), | |
is_page_template('views/template-custom.blade.php') | |
]); | |
return $display; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment