-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
67 lines (60 loc) · 1.7 KB
/
functions.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
66
67
<?php
/**
* This file adds functions to the DualTone WordPress theme.
*
* @package DualTone
* @author David Ballarin Prunera
* @license GNU General Public License v2
* @link https://ballarinconsulting.com/dualtone
*/
/**
* Include required files from inc folder
*/
require_once 'inc/theme/class-dualtone-theme.php';
require_once 'inc/settings/class-dualtone-settings.php';
require_once 'inc/data/block-style-variations.php';
require_once 'inc/data/custom-template-areas.php';
require_once 'inc/data/scripts.php';
require_once 'inc/data/theme-pattern-categories.php';
$styles = ['style.css'];
/**
* Add theme development utilities
*/
if( defined( "DT_HIGHLIGHT_PARTS") ) {
if( WP_DEVELOPMENT_MODE == 'theme' && DT_HIGHLIGHT_PARTS ) {
add_filter( 'body_class','dualtone_highlight_parts' );
$styles = ['style.css', 'style-debug.css'];
}
}
function dualtone_highlight_parts( $classes ) {
$classes[] = 'highlight-parts';
return $classes;
}
if ( defined( "WP_ENVIRONMENT_TYPE" ) ) {
if( WP_ENVIRONMENT_TYPE =='demo' || WP_ENVIRONMENT_TYPE =='local' ) {
add_filter( 'body_class', function( $classes ) {
$classes[] = 'demo';
return $classes;
});
}
}
/**
* Creates an instance of the DualTone_Theme class
*/
$dualtone_theme = new DualTone_Theme(
[
'textdomain' => 'dualtone',
'styles' => $styles,
'editor_styles' => ['style.css', 'style-editor.css'],
'scripts' => $scripts,
'variations' => $variations,
'areas' => $areas,
'pattern_categories' => $categories
]
);
/**
* Adds the theme settings page
*/
if( is_admin() ) {
$settings_page = new DualTone_Settings( 'dualtone' );
}