2
2
/**
3
3
* Storefront Class
4
4
*
5
- * @author WooThemes
6
5
* @since 2.0.0
7
6
* @package storefront
8
7
*/
@@ -70,15 +69,17 @@ public function setup() {
70
69
add_theme_support ( 'post-thumbnails ' );
71
70
72
71
/**
73
- * Enable support for site logo
72
+ * Enable support for site logo.
74
73
*/
75
74
add_theme_support ( 'custom-logo ' , apply_filters ( 'storefront_custom_logo_args ' , array (
76
75
'height ' => 110 ,
77
76
'width ' => 470 ,
78
77
'flex-width ' => true ,
79
78
) ) );
80
79
81
- // This theme uses wp_nav_menu() in two locations.
80
+ /**
81
+ * Register menu locations.
82
+ */
82
83
register_nav_menus ( apply_filters ( 'storefront_register_nav_menus ' , array (
83
84
'primary ' => __ ( 'Primary Menu ' , 'storefront ' ),
84
85
'secondary ' => __ ( 'Secondary Menu ' , 'storefront ' ),
@@ -98,12 +99,26 @@ public function setup() {
98
99
'widgets ' ,
99
100
) ) );
100
101
101
- // Setup the WordPress core custom background feature.
102
+ /**
103
+ * Setup the WordPress core custom background feature.
104
+ */
102
105
add_theme_support ( 'custom-background ' , apply_filters ( 'storefront_custom_background_args ' , array (
103
106
'default-color ' => apply_filters ( 'storefront_default_background_color ' , 'ffffff ' ),
104
107
'default-image ' => '' ,
105
108
) ) );
106
109
110
+ /**
111
+ * Setup the WordPress core custom header feature.
112
+ */
113
+ add_theme_support ( 'custom-header ' , apply_filters ( 'storefront_custom_header_args ' , array (
114
+ 'default-image ' => '' ,
115
+ 'header-text ' => false ,
116
+ 'width ' => 1950 ,
117
+ 'height ' => 500 ,
118
+ 'flex-width ' => true ,
119
+ 'flex-height ' => true ,
120
+ ) ) );
121
+
107
122
/**
108
123
* Add support for the Site Logo plugin and the site logo functionality in JetPack
109
124
* https://github.com/automattic/site-logo
@@ -113,27 +128,14 @@ public function setup() {
113
128
'size ' => 'full '
114
129
) ) );
115
130
116
- // Declare WooCommerce support.
117
- add_theme_support ( 'woocommerce ' , apply_filters ( 'storefront_woocommerce_args ' , array (
118
- 'single_image_width ' => 416 ,
119
- 'thumbnail_image_width ' => 324 ,
120
- 'product_grid ' => array (
121
- 'default_columns ' => 3 ,
122
- 'default_rows ' => 4 ,
123
- 'min_columns ' => 1 ,
124
- 'max_columns ' => 6 ,
125
- 'min_rows ' => 1
126
- )
127
- ) ) );
128
-
129
- add_theme_support ( 'wc-product-gallery-zoom ' );
130
- add_theme_support ( 'wc-product-gallery-lightbox ' );
131
- add_theme_support ( 'wc-product-gallery-slider ' );
132
-
133
- // Declare support for title theme feature.
131
+ /**
132
+ * Declare support for title theme feature.
133
+ */
134
134
add_theme_support ( 'title-tag ' );
135
135
136
- // Declare support for selective refreshing of widgets.
136
+ /**
137
+ * Declare support for selective refreshing of widgets.
138
+ */
137
139
add_theme_support ( 'customize-selective-refresh-widgets ' );
138
140
}
139
141
@@ -300,14 +302,17 @@ public function page_menu_args( $args ) {
300
302
* @return array
301
303
*/
302
304
public function body_classes ( $ classes ) {
303
- // Adds a class of group-blog to blogs with more than 1 published author.
305
+ // Adds a class to blogs with more than 1 published author.
304
306
if ( is_multi_author () ) {
305
307
$ classes [] = 'group-blog ' ;
306
308
}
307
309
308
- if ( ! function_exists ( 'woocommerce_breadcrumb ' ) ) {
309
- $ classes [] = 'no-wc-breadcrumb ' ;
310
- }
310
+ /**
311
+ * Adds a class when WooCommerce is not active.
312
+ *
313
+ * @todo Refactor child themes to remove dependency on this class.
314
+ */
315
+ $ classes [] = 'no-wc-breadcrumb ' ;
311
316
312
317
/**
313
318
* What is this?!
@@ -325,12 +330,12 @@ public function body_classes( $classes ) {
325
330
$ classes [] = 'storefront-full-width-content ' ;
326
331
}
327
332
328
- // Add class when using homepage template + featured image
333
+ // Add class when using homepage template + featured image.
329
334
if ( is_page_template ( 'template-homepage.php ' ) && has_post_thumbnail () ) {
330
335
$ classes [] = 'has-post-thumbnail ' ;
331
336
}
332
337
333
- // Add class when Secondary Navigation is in use
338
+ // Add class when Secondary Navigation is in use.
334
339
if ( has_nav_menu ( 'secondary ' ) ) {
335
340
$ classes [] = 'storefront-secondary-navigation ' ;
336
341
}
0 commit comments