@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Twenty Fifteen Customizer functionality |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * Twenty Fifteen Customizer functionality |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Add postMessage support for site title and description for the Customizer. |
@@ -14,73 +14,73 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @param WP_Customize_Manager $wp_customize Customizer object. |
16 | 16 | */ |
17 | -function twentyfifteen_customize_register( $wp_customize ) { |
|
17 | +function twentyfifteen_customize_register($wp_customize) { |
|
18 | 18 | $color_scheme = twentyfifteen_get_color_scheme(); |
19 | 19 | |
20 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
21 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
20 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
21 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
22 | 22 | |
23 | - if ( isset( $wp_customize->selective_refresh ) ) { |
|
24 | - $wp_customize->selective_refresh->add_partial( 'blogname', array( |
|
23 | + if (isset($wp_customize->selective_refresh)) { |
|
24 | + $wp_customize->selective_refresh->add_partial('blogname', array( |
|
25 | 25 | 'selector' => '.site-title a', |
26 | 26 | 'container_inclusive' => false, |
27 | 27 | 'render_callback' => 'twentyfifteen_customize_partial_blogname', |
28 | - ) ); |
|
29 | - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( |
|
28 | + )); |
|
29 | + $wp_customize->selective_refresh->add_partial('blogdescription', array( |
|
30 | 30 | 'selector' => '.site-description', |
31 | 31 | 'container_inclusive' => false, |
32 | 32 | 'render_callback' => 'twentyfifteen_customize_partial_blogdescription', |
33 | - ) ); |
|
33 | + )); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Add color scheme setting and control. |
37 | - $wp_customize->add_setting( 'color_scheme', array( |
|
37 | + $wp_customize->add_setting('color_scheme', array( |
|
38 | 38 | 'default' => 'default', |
39 | 39 | 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', |
40 | 40 | 'transport' => 'postMessage', |
41 | - ) ); |
|
41 | + )); |
|
42 | 42 | |
43 | - $wp_customize->add_control( 'color_scheme', array( |
|
44 | - 'label' => __( 'Base Color Scheme', 'twentyfifteen' ), |
|
43 | + $wp_customize->add_control('color_scheme', array( |
|
44 | + 'label' => __('Base Color Scheme', 'twentyfifteen'), |
|
45 | 45 | 'section' => 'colors', |
46 | 46 | 'type' => 'select', |
47 | 47 | 'choices' => twentyfifteen_get_color_scheme_choices(), |
48 | 48 | 'priority' => 1, |
49 | - ) ); |
|
49 | + )); |
|
50 | 50 | |
51 | 51 | // Add custom header and sidebar text color setting and control. |
52 | - $wp_customize->add_setting( 'sidebar_textcolor', array( |
|
52 | + $wp_customize->add_setting('sidebar_textcolor', array( |
|
53 | 53 | 'default' => $color_scheme[4], |
54 | 54 | 'sanitize_callback' => 'sanitize_hex_color', |
55 | 55 | 'transport' => 'postMessage', |
56 | - ) ); |
|
56 | + )); |
|
57 | 57 | |
58 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_textcolor', array( |
|
59 | - 'label' => __( 'Header and Sidebar Text Color', 'twentyfifteen' ), |
|
60 | - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), |
|
58 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'sidebar_textcolor', array( |
|
59 | + 'label' => __('Header and Sidebar Text Color', 'twentyfifteen'), |
|
60 | + 'description' => __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'), |
|
61 | 61 | 'section' => 'colors', |
62 | - ) ) ); |
|
62 | + ))); |
|
63 | 63 | |
64 | 64 | // Remove the core header textcolor control, as it shares the sidebar text color. |
65 | - $wp_customize->remove_control( 'header_textcolor' ); |
|
65 | + $wp_customize->remove_control('header_textcolor'); |
|
66 | 66 | |
67 | 67 | // Add custom header and sidebar background color setting and control. |
68 | - $wp_customize->add_setting( 'header_background_color', array( |
|
68 | + $wp_customize->add_setting('header_background_color', array( |
|
69 | 69 | 'default' => $color_scheme[1], |
70 | 70 | 'sanitize_callback' => 'sanitize_hex_color', |
71 | 71 | 'transport' => 'postMessage', |
72 | - ) ); |
|
72 | + )); |
|
73 | 73 | |
74 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array( |
|
75 | - 'label' => __( 'Header and Sidebar Background Color', 'twentyfifteen' ), |
|
76 | - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), |
|
74 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array( |
|
75 | + 'label' => __('Header and Sidebar Background Color', 'twentyfifteen'), |
|
76 | + 'description' => __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'), |
|
77 | 77 | 'section' => 'colors', |
78 | - ) ) ); |
|
78 | + ))); |
|
79 | 79 | |
80 | 80 | // Add an additional description to the header image section. |
81 | - $wp_customize->get_section( 'header_image' )->description = __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ); |
|
81 | + $wp_customize->get_section('header_image')->description = __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'); |
|
82 | 82 | } |
83 | -add_action( 'customize_register', 'twentyfifteen_customize_register', 11 ); |
|
83 | +add_action('customize_register', 'twentyfifteen_customize_register', 11); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Render the site title for the selective refresh partial. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return void |
92 | 92 | */ |
93 | 93 | function twentyfifteen_customize_partial_blogname() { |
94 | - bloginfo( 'name' ); |
|
94 | + bloginfo('name'); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return void |
104 | 104 | */ |
105 | 105 | function twentyfifteen_customize_partial_blogdescription() { |
106 | - bloginfo( 'description' ); |
|
106 | + bloginfo('description'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | * } |
146 | 146 | * } |
147 | 147 | */ |
148 | - return apply_filters( 'twentyfifteen_color_schemes', array( |
|
148 | + return apply_filters('twentyfifteen_color_schemes', array( |
|
149 | 149 | 'default' => array( |
150 | - 'label' => __( 'Default', 'twentyfifteen' ), |
|
150 | + 'label' => __('Default', 'twentyfifteen'), |
|
151 | 151 | 'colors' => array( |
152 | 152 | '#f1f1f1', |
153 | 153 | '#ffffff', |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | ), |
159 | 159 | ), |
160 | 160 | 'dark' => array( |
161 | - 'label' => __( 'Dark', 'twentyfifteen' ), |
|
161 | + 'label' => __('Dark', 'twentyfifteen'), |
|
162 | 162 | 'colors' => array( |
163 | 163 | '#111111', |
164 | 164 | '#202020', |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ), |
170 | 170 | ), |
171 | 171 | 'yellow' => array( |
172 | - 'label' => __( 'Yellow', 'twentyfifteen' ), |
|
172 | + 'label' => __('Yellow', 'twentyfifteen'), |
|
173 | 173 | 'colors' => array( |
174 | 174 | '#f4ca16', |
175 | 175 | '#ffdf00', |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | ), |
181 | 181 | ), |
182 | 182 | 'pink' => array( |
183 | - 'label' => __( 'Pink', 'twentyfifteen' ), |
|
183 | + 'label' => __('Pink', 'twentyfifteen'), |
|
184 | 184 | 'colors' => array( |
185 | 185 | '#ffe5d1', |
186 | 186 | '#e53b51', |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | ), |
192 | 192 | ), |
193 | 193 | 'purple' => array( |
194 | - 'label' => __( 'Purple', 'twentyfifteen' ), |
|
194 | + 'label' => __('Purple', 'twentyfifteen'), |
|
195 | 195 | 'colors' => array( |
196 | 196 | '#674970', |
197 | 197 | '#2e2256', |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ), |
203 | 203 | ), |
204 | 204 | 'blue' => array( |
205 | - 'label' => __( 'Blue', 'twentyfifteen' ), |
|
205 | + 'label' => __('Blue', 'twentyfifteen'), |
|
206 | 206 | 'colors' => array( |
207 | 207 | '#e9f2f9', |
208 | 208 | '#55c3dc', |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | '#f1f1f1', |
213 | 213 | ), |
214 | 214 | ), |
215 | - ) ); |
|
215 | + )); |
|
216 | 216 | } |
217 | 217 | |
218 | -if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) : |
|
218 | +if ( ! function_exists('twentyfifteen_get_color_scheme')) : |
|
219 | 219 | /** |
220 | 220 | * Get the current Twenty Fifteen color scheme. |
221 | 221 | * |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | * @return array An associative array of either the current or default color scheme hex values. |
225 | 225 | */ |
226 | 226 | function twentyfifteen_get_color_scheme() { |
227 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
227 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
228 | 228 | $color_schemes = twentyfifteen_get_color_schemes(); |
229 | 229 | |
230 | - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { |
|
231 | - return $color_schemes[ $color_scheme_option ]['colors']; |
|
230 | + if (array_key_exists($color_scheme_option, $color_schemes)) { |
|
231 | + return $color_schemes[$color_scheme_option]['colors']; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | return $color_schemes['default']['colors']; |
235 | 235 | } |
236 | 236 | endif; // twentyfifteen_get_color_scheme |
237 | 237 | |
238 | -if ( ! function_exists( 'twentyfifteen_get_color_scheme_choices' ) ) : |
|
238 | +if ( ! function_exists('twentyfifteen_get_color_scheme_choices')) : |
|
239 | 239 | /** |
240 | 240 | * Returns an array of color scheme choices registered for Twenty Fifteen. |
241 | 241 | * |
@@ -247,15 +247,15 @@ discard block |
||
247 | 247 | $color_schemes = twentyfifteen_get_color_schemes(); |
248 | 248 | $color_scheme_control_options = array(); |
249 | 249 | |
250 | - foreach ( $color_schemes as $color_scheme => $value ) { |
|
251 | - $color_scheme_control_options[ $color_scheme ] = $value['label']; |
|
250 | + foreach ($color_schemes as $color_scheme => $value) { |
|
251 | + $color_scheme_control_options[$color_scheme] = $value['label']; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | return $color_scheme_control_options; |
255 | 255 | } |
256 | 256 | endif; // twentyfifteen_get_color_scheme_choices |
257 | 257 | |
258 | -if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) : |
|
258 | +if ( ! function_exists('twentyfifteen_sanitize_color_scheme')) : |
|
259 | 259 | /** |
260 | 260 | * Sanitization callback for color schemes. |
261 | 261 | * |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | * @param string $value Color scheme name value. |
265 | 265 | * @return string Color scheme name. |
266 | 266 | */ |
267 | -function twentyfifteen_sanitize_color_scheme( $value ) { |
|
267 | +function twentyfifteen_sanitize_color_scheme($value) { |
|
268 | 268 | $color_schemes = twentyfifteen_get_color_scheme_choices(); |
269 | 269 | |
270 | - if ( ! array_key_exists( $value, $color_schemes ) ) { |
|
270 | + if ( ! array_key_exists($value, $color_schemes)) { |
|
271 | 271 | $value = 'default'; |
272 | 272 | } |
273 | 273 | |
@@ -283,38 +283,38 @@ discard block |
||
283 | 283 | * @see wp_add_inline_style() |
284 | 284 | */ |
285 | 285 | function twentyfifteen_color_scheme_css() { |
286 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
286 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
287 | 287 | |
288 | 288 | // Don't do anything if the default color scheme is selected. |
289 | - if ( 'default' === $color_scheme_option ) { |
|
289 | + if ('default' === $color_scheme_option) { |
|
290 | 290 | return; |
291 | 291 | } |
292 | 292 | |
293 | 293 | $color_scheme = twentyfifteen_get_color_scheme(); |
294 | 294 | |
295 | 295 | // Convert main and sidebar text hex color to rgba. |
296 | - $color_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[3] ); |
|
297 | - $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[4] ); |
|
296 | + $color_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[3]); |
|
297 | + $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[4]); |
|
298 | 298 | $colors = array( |
299 | 299 | 'background_color' => $color_scheme[0], |
300 | 300 | 'header_background_color' => $color_scheme[1], |
301 | 301 | 'box_background_color' => $color_scheme[2], |
302 | 302 | 'textcolor' => $color_scheme[3], |
303 | - 'secondary_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb ), |
|
304 | - 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb ), |
|
305 | - 'border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb ), |
|
303 | + 'secondary_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb), |
|
304 | + 'border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb), |
|
305 | + 'border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb), |
|
306 | 306 | 'sidebar_textcolor' => $color_scheme[4], |
307 | - 'sidebar_border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb ), |
|
308 | - 'sidebar_border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb ), |
|
309 | - 'secondary_sidebar_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb ), |
|
307 | + 'sidebar_border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb), |
|
308 | + 'sidebar_border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb), |
|
309 | + 'secondary_sidebar_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb), |
|
310 | 310 | 'meta_box_background_color' => $color_scheme[5], |
311 | 311 | ); |
312 | 312 | |
313 | - $color_scheme_css = twentyfifteen_get_color_scheme_css( $colors ); |
|
313 | + $color_scheme_css = twentyfifteen_get_color_scheme_css($colors); |
|
314 | 314 | |
315 | - wp_add_inline_style( 'twentyfifteen-style', $color_scheme_css ); |
|
315 | + wp_add_inline_style('twentyfifteen-style', $color_scheme_css); |
|
316 | 316 | } |
317 | -add_action( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' ); |
|
317 | +add_action('wp_enqueue_scripts', 'twentyfifteen_color_scheme_css'); |
|
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Binds JS listener to make Customizer color_scheme control. |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | * @since Twenty Fifteen 1.0 |
325 | 325 | */ |
326 | 326 | function twentyfifteen_customize_control_js() { |
327 | - wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true ); |
|
328 | - wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() ); |
|
327 | + wp_enqueue_script('color-scheme-control', get_template_directory_uri().'/js/color-scheme-control.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), '20141216', true); |
|
328 | + wp_localize_script('color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes()); |
|
329 | 329 | } |
330 | -add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' ); |
|
330 | +add_action('customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js'); |
|
331 | 331 | |
332 | 332 | /** |
333 | 333 | * Binds JS handlers to make the Customizer preview reload changes asynchronously. |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | * @since Twenty Fifteen 1.0 |
336 | 336 | */ |
337 | 337 | function twentyfifteen_customize_preview_js() { |
338 | - wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141216', true ); |
|
338 | + wp_enqueue_script('twentyfifteen-customize-preview', get_template_directory_uri().'/js/customize-preview.js', array('customize-preview'), '20141216', true); |
|
339 | 339 | } |
340 | -add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' ); |
|
340 | +add_action('customize_preview_init', 'twentyfifteen_customize_preview_js'); |
|
341 | 341 | |
342 | 342 | /** |
343 | 343 | * Returns CSS for the color schemes. |
@@ -347,8 +347,8 @@ discard block |
||
347 | 347 | * @param array $colors Color scheme colors. |
348 | 348 | * @return string Color scheme CSS. |
349 | 349 | */ |
350 | -function twentyfifteen_get_color_scheme_css( $colors ) { |
|
351 | - $colors = wp_parse_args( $colors, array( |
|
350 | +function twentyfifteen_get_color_scheme_css($colors) { |
|
351 | + $colors = wp_parse_args($colors, array( |
|
352 | 352 | 'background_color' => '', |
353 | 353 | 'header_background_color' => '', |
354 | 354 | 'box_background_color' => '', |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | 'sidebar_border_focus_color' => '', |
362 | 362 | 'secondary_sidebar_textcolor' => '', |
363 | 363 | 'meta_box_background_color' => '', |
364 | - ) ); |
|
364 | + )); |
|
365 | 365 | |
366 | 366 | $css = <<<CSS |
367 | 367 | /* Color Scheme */ |
@@ -766,8 +766,8 @@ discard block |
||
766 | 766 | ); |
767 | 767 | ?> |
768 | 768 | <script type="text/html" id="tmpl-twentyfifteen-color-scheme"> |
769 | - <?php echo twentyfifteen_get_color_scheme_css( $colors ); ?> |
|
769 | + <?php echo twentyfifteen_get_color_scheme_css($colors); ?> |
|
770 | 770 | </script> |
771 | 771 | <?php |
772 | 772 | } |
773 | -add_action( 'customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template' ); |
|
773 | +add_action('customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template'); |
@@ -21,39 +21,39 @@ |
||
21 | 21 | <section id="primary" class="content-area"> |
22 | 22 | <main id="main" class="site-main" role="main"> |
23 | 23 | |
24 | - <?php if ( have_posts() ) : ?> |
|
24 | + <?php if (have_posts()) : ?> |
|
25 | 25 | |
26 | 26 | <header class="page-header"> |
27 | 27 | <?php |
28 | - the_archive_title( '<h1 class="page-title">', '</h1>' ); |
|
29 | - the_archive_description( '<div class="taxonomy-description">', '</div>' ); |
|
28 | + the_archive_title('<h1 class="page-title">', '</h1>'); |
|
29 | + the_archive_description('<div class="taxonomy-description">', '</div>'); |
|
30 | 30 | ?> |
31 | 31 | </header><!-- .page-header --> |
32 | 32 | |
33 | 33 | <?php |
34 | 34 | // Start the Loop. |
35 | - while ( have_posts() ) : the_post(); |
|
35 | + while (have_posts()) : the_post(); |
|
36 | 36 | |
37 | 37 | /* |
38 | 38 | * Include the Post-Format-specific template for the content. |
39 | 39 | * If you want to override this in a child theme, then include a file |
40 | 40 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
41 | 41 | */ |
42 | - get_template_part( 'content', get_post_format() ); |
|
42 | + get_template_part('content', get_post_format()); |
|
43 | 43 | |
44 | 44 | // End the loop. |
45 | 45 | endwhile; |
46 | 46 | |
47 | 47 | // Previous/next page navigation. |
48 | - the_posts_pagination( array( |
|
49 | - 'prev_text' => __( 'Previous page', 'twentyfifteen' ), |
|
50 | - 'next_text' => __( 'Next page', 'twentyfifteen' ), |
|
51 | - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', |
|
52 | - ) ); |
|
48 | + the_posts_pagination(array( |
|
49 | + 'prev_text' => __('Previous page', 'twentyfifteen'), |
|
50 | + 'next_text' => __('Next page', 'twentyfifteen'), |
|
51 | + 'before_page_number' => '<span class="meta-nav screen-reader-text">'.__('Page', 'twentyfifteen').' </span>', |
|
52 | + )); |
|
53 | 53 | |
54 | 54 | // If no content, include the "No posts found" template. |
55 | 55 | else : |
56 | - get_template_part( 'content', 'none' ); |
|
56 | + get_template_part('content', 'none'); |
|
57 | 57 | |
58 | 58 | endif; |
59 | 59 | ?> |
@@ -52,8 +52,10 @@ |
||
52 | 52 | ) ); |
53 | 53 | |
54 | 54 | // If no content, include the "No posts found" template. |
55 | - else : |
|
55 | + else { |
|
56 | + : |
|
56 | 57 | get_template_part( 'content', 'none' ); |
58 | + } |
|
57 | 59 | |
58 | 60 | endif; |
59 | 61 | ?> |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying archive pages |
|
4 | - * |
|
5 | - * Used to display archive-type pages if nothing more specific matches a query. |
|
6 | - * For example, puts together date-based pages if no date.php file exists. |
|
7 | - * |
|
8 | - * If you'd like to further customize these archive views, you may create a |
|
9 | - * new template file for each one. For example, tag.php (Tag archives), |
|
10 | - * category.php (Category archives), author.php (Author archives), etc. |
|
11 | - * |
|
12 | - * @link https://codex.wordpress.org/Template_Hierarchy |
|
13 | - * |
|
14 | - * @package WordPress |
|
15 | - * @subpackage Twenty_Fifteen |
|
16 | - * @since Twenty Fifteen 1.0 |
|
17 | - */ |
|
3 | + * The template for displaying archive pages |
|
4 | + * |
|
5 | + * Used to display archive-type pages if nothing more specific matches a query. |
|
6 | + * For example, puts together date-based pages if no date.php file exists. |
|
7 | + * |
|
8 | + * If you'd like to further customize these archive views, you may create a |
|
9 | + * new template file for each one. For example, tag.php (Tag archives), |
|
10 | + * category.php (Category archives), author.php (Author archives), etc. |
|
11 | + * |
|
12 | + * @link https://codex.wordpress.org/Template_Hierarchy |
|
13 | + * |
|
14 | + * @package WordPress |
|
15 | + * @subpackage Twenty_Fifteen |
|
16 | + * @since Twenty Fifteen 1.0 |
|
17 | + */ |
|
18 | 18 | |
19 | 19 | get_header(); ?> |
20 | 20 |
@@ -14,29 +14,29 @@ |
||
14 | 14 | |
15 | 15 | <?php |
16 | 16 | // Start the loop. |
17 | - while ( have_posts() ) : the_post(); |
|
17 | + while (have_posts()) : the_post(); |
|
18 | 18 | |
19 | 19 | /* |
20 | 20 | * Include the post format-specific template for the content. If you want to |
21 | 21 | * use this in a child theme, then include a file called called content-___.php |
22 | 22 | * (where ___ is the post format) and that will be used instead. |
23 | 23 | */ |
24 | - get_template_part( 'content', get_post_format() ); |
|
24 | + get_template_part('content', get_post_format()); |
|
25 | 25 | |
26 | 26 | // If comments are open or we have at least one comment, load up the comment template. |
27 | - if ( comments_open() || get_comments_number() ) : |
|
27 | + if (comments_open() || get_comments_number()) : |
|
28 | 28 | comments_template(); |
29 | 29 | endif; |
30 | 30 | |
31 | 31 | // Previous/next post navigation. |
32 | - the_post_navigation( array( |
|
33 | - 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' . |
|
34 | - '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' . |
|
32 | + the_post_navigation(array( |
|
33 | + 'next_text' => '<span class="meta-nav" aria-hidden="true">'.__('Next', 'twentyfifteen').'</span> '. |
|
34 | + '<span class="screen-reader-text">'.__('Next post:', 'twentyfifteen').'</span> '. |
|
35 | 35 | '<span class="post-title">%title</span>', |
36 | - 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' . |
|
37 | - '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' . |
|
36 | + 'prev_text' => '<span class="meta-nav" aria-hidden="true">'.__('Previous', 'twentyfifteen').'</span> '. |
|
37 | + '<span class="screen-reader-text">'.__('Previous post:', 'twentyfifteen').'</span> '. |
|
38 | 38 | '<span class="post-title">%title</span>', |
39 | - ) ); |
|
39 | + )); |
|
40 | 40 | |
41 | 41 | // End the loop. |
42 | 42 | endwhile; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying all single posts and attachments |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying all single posts and attachments |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -15,23 +15,23 @@ |
||
15 | 15 | ?> |
16 | 16 | |
17 | 17 | <header class="entry-header"> |
18 | - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> |
|
18 | + <?php the_title('<h1 class="entry-title">', '</h1>'); ?> |
|
19 | 19 | </header><!-- .entry-header --> |
20 | 20 | |
21 | 21 | <div class="entry-content"> |
22 | 22 | <?php the_content(); ?> |
23 | 23 | <?php |
24 | - wp_link_pages( array( |
|
25 | - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>', |
|
24 | + wp_link_pages(array( |
|
25 | + 'before' => '<div class="page-links"><span class="page-links-title">'.__('Pages:', 'twentyfifteen').'</span>', |
|
26 | 26 | 'after' => '</div>', |
27 | 27 | 'link_before' => '<span>', |
28 | 28 | 'link_after' => '</span>', |
29 | - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%', |
|
29 | + 'pagelink' => '<span class="screen-reader-text">'.__('Page', 'twentyfifteen').' </span>%', |
|
30 | 30 | 'separator' => '<span class="screen-reader-text">, </span>', |
31 | - ) ); |
|
31 | + )); |
|
32 | 32 | ?> |
33 | 33 | </div><!-- .entry-content --> |
34 | 34 | |
35 | - <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?> |
|
35 | + <?php edit_post_link(__('Edit', 'twentyfifteen'), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->'); ?> |
|
36 | 36 | |
37 | 37 | </article><!-- #post-## --> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template used for displaying page content |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * The template used for displaying page content |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying 404 pages (not found) |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying 404 pages (not found) |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -14,11 +14,11 @@ |
||
14 | 14 | |
15 | 15 | <section class="error-404 not-found"> |
16 | 16 | <header class="page-header"> |
17 | - <h1 class="page-title"><?php _e( 'Oops! That page can’t be found.', 'twentyfifteen' ); ?></h1> |
|
17 | + <h1 class="page-title"><?php _e('Oops! That page can’t be found.', 'twentyfifteen'); ?></h1> |
|
18 | 18 | </header><!-- .page-header --> |
19 | 19 | |
20 | 20 | <div class="page-content"> |
21 | - <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen' ); ?></p> |
|
21 | + <p><?php _e('It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen'); ?></p> |
|
22 | 22 | |
23 | 23 | <?php get_search_form(); ?> |
24 | 24 | </div><!-- .page-content --> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="author-info"> |
12 | - <h2 class="author-heading"><?php _e( 'Published by', 'twentyfifteen' ); ?></h2> |
|
12 | + <h2 class="author-heading"><?php _e('Published by', 'twentyfifteen'); ?></h2> |
|
13 | 13 | <div class="author-avatar"> |
14 | 14 | <?php |
15 | 15 | /** |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @param int $size The avatar height and width size in pixels. |
21 | 21 | */ |
22 | - $author_bio_avatar_size = apply_filters( 'twentyfifteen_author_bio_avatar_size', 56 ); |
|
22 | + $author_bio_avatar_size = apply_filters('twentyfifteen_author_bio_avatar_size', 56); |
|
23 | 23 | |
24 | - echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ); |
|
24 | + echo get_avatar(get_the_author_meta('user_email'), $author_bio_avatar_size); |
|
25 | 25 | ?> |
26 | 26 | </div><!-- .author-avatar --> |
27 | 27 | |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | <h3 class="author-title"><?php echo get_the_author(); ?></h3> |
30 | 30 | |
31 | 31 | <p class="author-bio"> |
32 | - <?php the_author_meta( 'description' ); ?> |
|
33 | - <a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"> |
|
34 | - <?php printf( __( 'View all posts by %s', 'twentyfifteen' ), get_the_author() ); ?> |
|
32 | + <?php the_author_meta('description'); ?> |
|
33 | + <a class="author-link" href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" rel="author"> |
|
34 | + <?php printf(__('View all posts by %s', 'twentyfifteen'), get_the_author()); ?> |
|
35 | 35 | </a> |
36 | 36 | </p><!-- .author-bio --> |
37 | 37 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying Author bios |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying Author bios |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <div class="author-info"> |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The default template for displaying content |
|
4 | - * |
|
5 | - * Used for both single and index/archive/search. |
|
6 | - * |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Twenty_Fifteen |
|
9 | - * @since Twenty Fifteen 1.0 |
|
10 | - */ |
|
3 | + * The default template for displaying content |
|
4 | + * |
|
5 | + * Used for both single and index/archive/search. |
|
6 | + * |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Twenty_Fifteen |
|
9 | + * @since Twenty Fifteen 1.0 |
|
10 | + */ |
|
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | |
19 | 19 | <header class="entry-header"> |
20 | 20 | <?php |
21 | - if ( is_single() ) : |
|
22 | - the_title( '<h1 class="entry-title">', '</h1>' ); |
|
21 | + if (is_single()) : |
|
22 | + the_title('<h1 class="entry-title">', '</h1>'); |
|
23 | 23 | else : |
24 | - the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); |
|
24 | + the_title(sprintf('<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h2>'); |
|
25 | 25 | endif; |
26 | 26 | ?> |
27 | 27 | </header><!-- .entry-header --> |
@@ -29,32 +29,32 @@ discard block |
||
29 | 29 | <div class="entry-content"> |
30 | 30 | <?php |
31 | 31 | /* translators: %s: Name of current post */ |
32 | - the_content( sprintf( |
|
33 | - __( 'Continue reading %s', 'twentyfifteen' ), |
|
34 | - the_title( '<span class="screen-reader-text">', '</span>', false ) |
|
35 | - ) ); |
|
32 | + the_content(sprintf( |
|
33 | + __('Continue reading %s', 'twentyfifteen'), |
|
34 | + the_title('<span class="screen-reader-text">', '</span>', false) |
|
35 | + )); |
|
36 | 36 | |
37 | - wp_link_pages( array( |
|
38 | - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>', |
|
37 | + wp_link_pages(array( |
|
38 | + 'before' => '<div class="page-links"><span class="page-links-title">'.__('Pages:', 'twentyfifteen').'</span>', |
|
39 | 39 | 'after' => '</div>', |
40 | 40 | 'link_before' => '<span>', |
41 | 41 | 'link_after' => '</span>', |
42 | - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%', |
|
42 | + 'pagelink' => '<span class="screen-reader-text">'.__('Page', 'twentyfifteen').' </span>%', |
|
43 | 43 | 'separator' => '<span class="screen-reader-text">, </span>', |
44 | - ) ); |
|
44 | + )); |
|
45 | 45 | ?> |
46 | 46 | </div><!-- .entry-content --> |
47 | 47 | |
48 | 48 | <?php |
49 | 49 | // Author bio. |
50 | - if ( is_single() && get_the_author_meta( 'description' ) ) : |
|
51 | - get_template_part( 'author-bio' ); |
|
50 | + if (is_single() && get_the_author_meta('description')) : |
|
51 | + get_template_part('author-bio'); |
|
52 | 52 | endif; |
53 | 53 | ?> |
54 | 54 | |
55 | 55 | <footer class="entry-footer"> |
56 | 56 | <?php twentyfifteen_entry_meta(); ?> |
57 | - <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?> |
|
57 | + <?php edit_post_link(__('Edit', 'twentyfifteen'), '<span class="edit-link">', '</span>'); ?> |
|
58 | 58 | </footer><!-- .entry-footer --> |
59 | 59 | |
60 | 60 | </article><!-- #post-## --> |
@@ -21,8 +21,10 @@ |
||
21 | 21 | |
22 | 22 | if ( is_single() ) : |
23 | 23 | the_title( '<h1 class="entry-title">', '</h1>' ); |
24 | - else : |
|
24 | + else { |
|
25 | + : |
|
25 | 26 | the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); |
27 | + } |
|
26 | 28 | endif; |
27 | 29 | ?> |
28 | 30 |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | * the visitor has not yet entered the password we will |
16 | 16 | * return early without loading the comments. |
17 | 17 | */ |
18 | -if ( post_password_required() ) { |
|
18 | +if (post_password_required()) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 | ?> |
22 | 22 | |
23 | 23 | <div id="comments" class="comments-area"> |
24 | 24 | |
25 | - <?php if ( have_comments() ) : ?> |
|
25 | + <?php if (have_comments()) : ?> |
|
26 | 26 | <h2 class="comments-title"> |
27 | 27 | <?php |
28 | - printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentyfifteen' ), |
|
29 | - number_format_i18n( get_comments_number() ), get_the_title() ); |
|
28 | + printf(_nx('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentyfifteen'), |
|
29 | + number_format_i18n(get_comments_number()), get_the_title()); |
|
30 | 30 | ?> |
31 | 31 | </h2> |
32 | 32 | |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | |
35 | 35 | <ol class="comment-list"> |
36 | 36 | <?php |
37 | - wp_list_comments( array( |
|
37 | + wp_list_comments(array( |
|
38 | 38 | 'style' => 'ol', |
39 | 39 | 'short_ping' => true, |
40 | 40 | 'avatar_size' => 56, |
41 | - ) ); |
|
41 | + )); |
|
42 | 42 | ?> |
43 | 43 | </ol><!-- .comment-list --> |
44 | 44 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | <?php |
50 | 50 | // If comments are closed and there are comments, let's leave a little note, shall we? |
51 | - if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
51 | + if ( ! comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')) : |
|
52 | 52 | ?> |
53 | - <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> |
|
53 | + <p class="no-comments"><?php _e('Comments are closed.', 'twentyfifteen'); ?></p> |
|
54 | 54 | <?php endif; ?> |
55 | 55 | |
56 | 56 | <?php comment_form(); ?> |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying comments |
|
4 | - * |
|
5 | - * The area of the page that contains both current comments |
|
6 | - * and the comment form. |
|
7 | - * |
|
8 | - * @package WordPress |
|
9 | - * @subpackage Twenty_Fifteen |
|
10 | - * @since Twenty Fifteen 1.0 |
|
11 | - */ |
|
3 | + * The template for displaying comments |
|
4 | + * |
|
5 | + * The area of the page that contains both current comments |
|
6 | + * and the comment form. |
|
7 | + * |
|
8 | + * @package WordPress |
|
9 | + * @subpackage Twenty_Fifteen |
|
10 | + * @since Twenty Fifteen 1.0 |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | /* |
14 | 14 | * If the current post is protected by a password and |
@@ -12,23 +12,23 @@ |
||
12 | 12 | |
13 | 13 | <section class="no-results not-found"> |
14 | 14 | <header class="page-header"> |
15 | - <h1 class="page-title"><?php _e( 'Nothing Found', 'twentyfifteen' ); ?></h1> |
|
15 | + <h1 class="page-title"><?php _e('Nothing Found', 'twentyfifteen'); ?></h1> |
|
16 | 16 | </header><!-- .page-header --> |
17 | 17 | |
18 | 18 | <div class="page-content"> |
19 | 19 | |
20 | - <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> |
|
20 | + <?php if (is_home() && current_user_can('publish_posts')) : ?> |
|
21 | 21 | |
22 | - <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfifteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> |
|
22 | + <p><?php printf(__('Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfifteen'), esc_url(admin_url('post-new.php'))); ?></p> |
|
23 | 23 | |
24 | - <?php elseif ( is_search() ) : ?> |
|
24 | + <?php elseif (is_search()) : ?> |
|
25 | 25 | |
26 | - <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p> |
|
26 | + <p><?php _e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen'); ?></p> |
|
27 | 27 | <?php get_search_form(); ?> |
28 | 28 | |
29 | 29 | <?php else : ?> |
30 | 30 | |
31 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p> |
|
31 | + <p><?php _e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentyfifteen'); ?></p> |
|
32 | 32 | <?php get_search_form(); ?> |
33 | 33 | |
34 | 34 | <?php endif; ?> |
@@ -26,9 +26,12 @@ |
||
26 | 26 | <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p> |
27 | 27 | <?php get_search_form(); ?> |
28 | 28 | |
29 | - <?php else : ?> |
|
29 | + <?php else { |
|
30 | + : ?> |
|
30 | 31 | |
31 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p> |
|
32 | + <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentyfifteen' ); |
|
33 | +} |
|
34 | +?></p> |
|
32 | 35 | <?php get_search_form(); ?> |
33 | 36 | |
34 | 37 | <?php endif; ?> |