forked from roots/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
65 lines (56 loc) · 1.79 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace Roots\Sage\Config;
use Roots\Sage\ConditionalTagCheck;
/**
* Enable theme features
*/
add_theme_support('soil-clean-up'); // Enable clean up from Soil
add_theme_support('soil-nav-walker'); // Enable cleaner nav walker from Soil
add_theme_support('soil-relative-urls'); // Enable relative URLs from Soil
add_theme_support('soil-nice-search'); // Enable nice search from Soil
add_theme_support('soil-jquery-cdn'); // Enable to load jQuery from the Google CDN
/**
* Configuration values
*/
if (!defined('WP_ENV')) {
// Fallback if WP_ENV isn't defined in your WordPress config
// Used in lib/assets.php to check for 'development' or 'production'
define('WP_ENV', 'production');
}
if (!defined('DIST_DIR')) {
// Path to the build directory for front-end assets
define('DIST_DIR', '/dist/');
}
/**
* Define which pages shouldn't have the sidebar
*/
function display_sidebar() {
static $display;
if (!isset($display)) {
$conditionalCheck = new ConditionalTagCheck(
/**
* Any of these conditional tags that return true won't show the sidebar.
* You can also specify your own custom function as long as it returns a boolean.
*
* To use a function that accepts arguments, use an array instead of just the function name as a string.
*
* Examples:
*
* 'is_single'
* 'is_archive'
* ['is_page', 'about-me']
* ['is_tax', ['flavor', 'mild']]
* ['is_page_template', 'about.php']
* ['is_post_type_archive', ['foo', 'bar', 'baz']]
*
*/
[
'is_404',
'is_front_page',
['is_page_template', 'template-custom.php']
]
);
$display = apply_filters('sage/display_sidebar', $conditionalCheck->result);
}
return $display;
}