-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathThemeConfig.php
169 lines (158 loc) · 4.78 KB
/
ThemeConfig.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/**
* Functions to access theme supports and theme configuration items
*
* @package Virtuoso\lib\Functions
* @since 2.1.7
* @author ErhardLabs
* @link https://sumnererhard.com https://graysonerhard.com
* @license GNU General Public License 2.0+
*/
namespace Virtuoso\Lib;
defined( 'ABSPATH' ) || exit;
class ThemeConfig {
public static function config_settings() {
return array(
// =============================================
// Theme support features to add
// =============================================
'add_theme_support' => array(
'html5' => array(
'caption',
'comment-form',
'comment-list',
'gallery',
'search-form',
),
'genesis-accessibility' => array(
'404-page',
'drop-down-menu',
'headings',
'rems',
'search-form',
'skip-links',
),
'genesis-responsive-viewport' => null,
'custom-header' => array(
'width' => 600,
'height' => 160,
'header-selector' => '.site-title a',
'header-text' => false,
'flex-height' => false,
'flex-width' => true,
'video' => false,
),
'custom-background' => null,
'genesis-after-entry-widget-area' => null,
'genesis-footer-widgets' => 4,
'genesis-menus' => array(
'primary' => __( 'Primary Navigation', CHILD_TEXT_DOMAIN, 'virtuoso' ),
'secondary' => __( 'Secondary Navigation', CHILD_TEXT_DOMAIN, 'virtuoso' ),
'footer' => __( 'Footer Navigation', CHILD_TEXT_DOMAIN, 'virtuoso' ),
),
'woocommerce',
'auto-wide',
// 'genesis-after-entry-widget-area' => null,
),
// =============================================
// Layouts to unregister
// =============================================
'genesis_unregister_layout' => array(
'sidebar-content',
// 'content-sidebar',
'content-sidebar-sidebar',
'sidebar-content-sidebar',
'sidebar-sidebar-content',
),
// =============================================
// Theme Default Settings
// =============================================
'theme_default_settings' => array(
'blog_cat_num' => 12,
'content_archive' => 'full',
'content_archive_limit' => 0,
'content_archive_thumbnail' => 0,
'posts_nav' => 'numeric',
'site_layout' => 'full-width-content',
'front-page-widgets' => array(
array(
'id' => 'front-page-1',
'name' => __( 'Front Page 1', 'virtuoso' ),
'description' => __( 'Front page 1 widget area.', 'virtuoso' ),
'before_title' => '<h1 itemprop="headline">',
'after_title' => '</h1>',
),
array(
'id' => 'front-page-2',
'name' => __( 'Front Page 2', 'virtuoso' ),
'description' => __( 'Front page 2 widget area.', 'virtuoso' ),
),
array(
'id' => 'front-page-3',
'name' => __( 'Front Page 3', 'virtuoso' ),
'description' => __( 'Front page 3 widget area.', 'virtuoso' ),
),
array(
'id' => 'front-page-4',
'name' => __( 'Front Page 4', 'virtuoso' ),
'description' => __( 'Front page 4 widget area.', 'virtuoso' ),
),
array(
'id' => 'front-page-5',
'name' => __( 'Front Page 5', 'virtuoso' ),
'description' => __( 'Front page 5 widget area.', 'virtuoso' ),
),
),
'sidebar-widgets' => array(
array(
'name' => __( 'Slide-Out Sidebar', 'virtuoso' ),
'id' => 'slider',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h4 class="widgettitle">',
'after_title' => '</h4>',
),
),
),
// =============================================
// Image Sizes
// =============================================
'theme_image_sizes' => array(
'featured-image' => array(
'width' => 720,
'height' => 400,
'crop' => true,
),
),
);
}
/**
* Get runtime configuration parameters.
*
* @since 2.1.7
*
* @param string $key Configuration parameter key
*
* @return array|null|mixed
*/
public static function get_configuration_parameters( $key = '' ) {
$config = self::config_settings();
if ( ! $key ) {
return $config;
}
if ( array_key_exists( $key, $config ) ) {
return $config[ $key ];
}
return $config;
}
/**
* Get the theme settings defaults.
*
* @since 1.0.0
*
* @return array
*/
public static function get_theme_settings_defaults() {
return self::get_configuration_parameters( 'theme_default_settings' );
}
}