@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying pages |
|
4 | - * |
|
5 | - * This is the template that displays all pages by default. |
|
6 | - * Please note that this is the WordPress construct of pages and that |
|
7 | - * other "pages" on your WordPress site will use a different template. |
|
8 | - * |
|
9 | - * @package WordPress |
|
10 | - * @subpackage Twenty_Fifteen |
|
11 | - * @since Twenty Fifteen 1.0 |
|
12 | - */ |
|
3 | + * The template for displaying pages |
|
4 | + * |
|
5 | + * This is the template that displays all pages by default. |
|
6 | + * Please note that this is the WordPress construct of pages and that |
|
7 | + * other "pages" on your WordPress site will use a different template. |
|
8 | + * |
|
9 | + * @package WordPress |
|
10 | + * @subpackage Twenty_Fifteen |
|
11 | + * @since Twenty Fifteen 1.0 |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | get_header(); ?> |
15 | 15 |
@@ -18,13 +18,13 @@ |
||
18 | 18 | |
19 | 19 | <?php |
20 | 20 | // Start the loop. |
21 | - while ( have_posts() ) : the_post(); |
|
21 | + while (have_posts()) : the_post(); |
|
22 | 22 | |
23 | 23 | // Include the page content template. |
24 | - get_template_part( 'content', 'page' ); |
|
24 | + get_template_part('content', 'page'); |
|
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 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * The template for displaying search results pages. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * The template for displaying search results pages. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | get_header(); ?> |
11 | 11 |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | <section id="primary" class="content-area"> |
13 | 13 | <main id="main" class="site-main" role="main"> |
14 | 14 | |
15 | - <?php if ( have_posts() ) : ?> |
|
15 | + <?php if (have_posts()) : ?> |
|
16 | 16 | |
17 | 17 | <header class="page-header"> |
18 | - <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1> |
|
18 | + <h1 class="page-title"><?php printf(__('Search Results for: %s', 'twentyfifteen'), get_search_query()); ?></h1> |
|
19 | 19 | </header><!-- .page-header --> |
20 | 20 | |
21 | 21 | <?php |
22 | 22 | // Start the loop. |
23 | - while ( have_posts() ) : the_post(); ?> |
|
23 | + while (have_posts()) : the_post(); ?> |
|
24 | 24 | |
25 | 25 | <?php |
26 | 26 | /* |
@@ -28,21 +28,21 @@ discard block |
||
28 | 28 | * If you want to overload this in a child theme then include a file |
29 | 29 | * called content-search.php and that will be used instead. |
30 | 30 | */ |
31 | - get_template_part( 'content', 'search' ); |
|
31 | + get_template_part('content', 'search'); |
|
32 | 32 | |
33 | 33 | // End the loop. |
34 | 34 | endwhile; |
35 | 35 | |
36 | 36 | // Previous/next page navigation. |
37 | - the_posts_pagination( array( |
|
38 | - 'prev_text' => __( 'Previous page', 'twentyfifteen' ), |
|
39 | - 'next_text' => __( 'Next page', 'twentyfifteen' ), |
|
40 | - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', |
|
41 | - ) ); |
|
37 | + the_posts_pagination(array( |
|
38 | + 'prev_text' => __('Previous page', 'twentyfifteen'), |
|
39 | + 'next_text' => __('Next page', 'twentyfifteen'), |
|
40 | + 'before_page_number' => '<span class="meta-nav screen-reader-text">'.__('Page', 'twentyfifteen').' </span>', |
|
41 | + )); |
|
42 | 42 | |
43 | 43 | // If no content, include the "No posts found" template. |
44 | 44 | else : |
45 | - get_template_part( 'content', 'none' ); |
|
45 | + get_template_part('content', 'none'); |
|
46 | 46 | |
47 | 47 | endif; |
48 | 48 | ?> |
@@ -41,8 +41,10 @@ |
||
41 | 41 | ) ); |
42 | 42 | |
43 | 43 | // If no content, include the "No posts found" template. |
44 | - else : |
|
44 | + else { |
|
45 | + : |
|
45 | 46 | get_template_part( 'content', 'none' ); |
47 | + } |
|
46 | 48 | |
47 | 49 | endif; |
48 | 50 | ?> |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Twenty Fifteen back compat functionality |
|
4 | - * |
|
5 | - * Prevents Twenty Fifteen from running on WordPress versions prior to 4.1, |
|
6 | - * since this theme is not meant to be backward compatible beyond that and |
|
7 | - * relies on many newer functions and markup changes introduced in 4.1. |
|
8 | - * |
|
9 | - * @package WordPress |
|
10 | - * @subpackage Twenty_Fifteen |
|
11 | - * @since Twenty Fifteen 1.0 |
|
12 | - */ |
|
3 | + * Twenty Fifteen back compat functionality |
|
4 | + * |
|
5 | + * Prevents Twenty Fifteen from running on WordPress versions prior to 4.1, |
|
6 | + * since this theme is not meant to be backward compatible beyond that and |
|
7 | + * relies on many newer functions and markup changes introduced in 4.1. |
|
8 | + * |
|
9 | + * @package WordPress |
|
10 | + * @subpackage Twenty_Fifteen |
|
11 | + * @since Twenty Fifteen 1.0 |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Prevent switching to Twenty Fifteen on old versions of WordPress. |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | * @since Twenty Fifteen 1.0 |
20 | 20 | */ |
21 | 21 | function twentyfifteen_switch_theme() { |
22 | - switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); |
|
23 | - unset( $_GET['activated'] ); |
|
24 | - add_action( 'admin_notices', 'twentyfifteen_upgrade_notice' ); |
|
22 | + switch_theme(WP_DEFAULT_THEME, WP_DEFAULT_THEME); |
|
23 | + unset($_GET['activated']); |
|
24 | + add_action('admin_notices', 'twentyfifteen_upgrade_notice'); |
|
25 | 25 | } |
26 | -add_action( 'after_switch_theme', 'twentyfifteen_switch_theme' ); |
|
26 | +add_action('after_switch_theme', 'twentyfifteen_switch_theme'); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Add message for unsuccessful theme switch. |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | * @since Twenty Fifteen 1.0 |
35 | 35 | */ |
36 | 36 | function twentyfifteen_upgrade_notice() { |
37 | - $message = sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ); |
|
38 | - printf( '<div class="error"><p>%s</p></div>', $message ); |
|
37 | + $message = sprintf(__('Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen'), $GLOBALS['wp_version']); |
|
38 | + printf('<div class="error"><p>%s</p></div>', $message); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | * @since Twenty Fifteen 1.0 |
45 | 45 | */ |
46 | 46 | function twentyfifteen_customize() { |
47 | - wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ), '', array( |
|
47 | + wp_die(sprintf(__('Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen'), $GLOBALS['wp_version']), '', array( |
|
48 | 48 | 'back_link' => true, |
49 | - ) ); |
|
49 | + )); |
|
50 | 50 | } |
51 | -add_action( 'load-customize.php', 'twentyfifteen_customize' ); |
|
51 | +add_action('load-customize.php', 'twentyfifteen_customize'); |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Prevent the Theme Preview from being loaded on WordPress versions prior to 4.1. |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * @since Twenty Fifteen 1.0 |
57 | 57 | */ |
58 | 58 | function twentyfifteen_preview() { |
59 | - if ( isset( $_GET['preview'] ) ) { |
|
60 | - wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ) ); |
|
59 | + if (isset($_GET['preview'])) { |
|
60 | + wp_die(sprintf(__('Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen'), $GLOBALS['wp_version'])); |
|
61 | 61 | } |
62 | 62 | } |
63 | -add_action( 'template_redirect', 'twentyfifteen_preview' ); |
|
63 | +add_action('template_redirect', 'twentyfifteen_preview'); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Custom Header functionality for Twenty Fifteen |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Fifteen |
|
7 | - * @since Twenty Fifteen 1.0 |
|
8 | - */ |
|
3 | + * Custom Header functionality for Twenty Fifteen |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Fifteen |
|
7 | + * @since Twenty Fifteen 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Set up the WordPress core custom header feature. |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function twentyfifteen_custom_header_setup() { |
16 | 16 | $color_scheme = twentyfifteen_get_color_scheme(); |
17 | - $default_text_color = trim( $color_scheme[4], '#' ); |
|
17 | + $default_text_color = trim($color_scheme[4], '#'); |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Filter Twenty Fifteen custom-header support arguments. |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | * displayed on the blog. |
32 | 32 | * } |
33 | 33 | */ |
34 | - add_theme_support( 'custom-header', apply_filters( 'twentyfifteen_custom_header_args', array( |
|
34 | + add_theme_support('custom-header', apply_filters('twentyfifteen_custom_header_args', array( |
|
35 | 35 | 'default-text-color' => $default_text_color, |
36 | 36 | 'width' => 954, |
37 | 37 | 'height' => 1300, |
38 | 38 | 'wp-head-callback' => 'twentyfifteen_header_style', |
39 | - ) ) ); |
|
39 | + ))); |
|
40 | 40 | } |
41 | -add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' ); |
|
41 | +add_action('after_setup_theme', 'twentyfifteen_custom_header_setup'); |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Convert HEX to RGB. |
@@ -49,25 +49,25 @@ discard block |
||
49 | 49 | * @return array Array containing RGB (red, green, and blue) values for the given |
50 | 50 | * HEX code, empty array otherwise. |
51 | 51 | */ |
52 | -function twentyfifteen_hex2rgb( $color ) { |
|
53 | - $color = trim( $color, '#' ); |
|
54 | - |
|
55 | - if ( strlen( $color ) == 3 ) { |
|
56 | - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); |
|
57 | - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); |
|
58 | - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); |
|
59 | - } else if ( strlen( $color ) == 6 ) { |
|
60 | - $r = hexdec( substr( $color, 0, 2 ) ); |
|
61 | - $g = hexdec( substr( $color, 2, 2 ) ); |
|
62 | - $b = hexdec( substr( $color, 4, 2 ) ); |
|
52 | +function twentyfifteen_hex2rgb($color) { |
|
53 | + $color = trim($color, '#'); |
|
54 | + |
|
55 | + if (strlen($color) == 3) { |
|
56 | + $r = hexdec(substr($color, 0, 1).substr($color, 0, 1)); |
|
57 | + $g = hexdec(substr($color, 1, 1).substr($color, 1, 1)); |
|
58 | + $b = hexdec(substr($color, 2, 1).substr($color, 2, 1)); |
|
59 | + } else if (strlen($color) == 6) { |
|
60 | + $r = hexdec(substr($color, 0, 2)); |
|
61 | + $g = hexdec(substr($color, 2, 2)); |
|
62 | + $b = hexdec(substr($color, 4, 2)); |
|
63 | 63 | } else { |
64 | 64 | return array(); |
65 | 65 | } |
66 | 66 | |
67 | - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); |
|
67 | + return array('red' => $r, 'green' => $g, 'blue' => $b); |
|
68 | 68 | } |
69 | 69 | |
70 | -if ( ! function_exists( 'twentyfifteen_header_style' ) ) : |
|
70 | +if ( ! function_exists('twentyfifteen_header_style')) : |
|
71 | 71 | /** |
72 | 72 | * Styles the header image and text displayed on the blog. |
73 | 73 | * |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $header_image = get_header_image(); |
80 | 80 | |
81 | 81 | // If no custom options for text are set, let's bail. |
82 | - if ( empty( $header_image ) && display_header_text() ) { |
|
82 | + if (empty($header_image) && display_header_text()) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <style type="text/css" id="twentyfifteen-header-css"> |
89 | 89 | <?php |
90 | 90 | // Short header for when there is no Custom Header and Header Text is hidden. |
91 | - if ( empty( $header_image ) && ! display_header_text() ) : |
|
91 | + if (empty($header_image) && ! display_header_text()) : |
|
92 | 92 | ?> |
93 | 93 | .site-header { |
94 | 94 | padding-top: 14px; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | endif; |
131 | 131 | |
132 | 132 | // Has a Custom Header been added? |
133 | - if ( ! empty( $header_image ) ) : |
|
133 | + if ( ! empty($header_image)) : |
|
134 | 134 | ?> |
135 | 135 | .site-header { |
136 | 136 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | endif; |
173 | 173 | |
174 | 174 | // Has the text been hidden? |
175 | - if ( ! display_header_text() ) : |
|
175 | + if ( ! display_header_text()) : |
|
176 | 176 | ?> |
177 | 177 | .site-title, |
178 | 178 | .site-description { |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | function twentyfifteen_header_background_color_css() { |
196 | 196 | $color_scheme = twentyfifteen_get_color_scheme(); |
197 | 197 | $default_color = $color_scheme[1]; |
198 | - $header_background_color = get_theme_mod( 'header_background_color', $default_color ); |
|
198 | + $header_background_color = get_theme_mod('header_background_color', $default_color); |
|
199 | 199 | |
200 | 200 | // Don't do anything if the current color is the default. |
201 | - if ( $header_background_color === $default_color ) { |
|
201 | + if ($header_background_color === $default_color) { |
|
202 | 202 | return; |
203 | 203 | } |
204 | 204 | |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | } |
228 | 228 | '; |
229 | 229 | |
230 | - wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $header_background_color ) ); |
|
230 | + wp_add_inline_style('twentyfifteen-style', sprintf($css, $header_background_color)); |
|
231 | 231 | } |
232 | -add_action( 'wp_enqueue_scripts', 'twentyfifteen_header_background_color_css', 11 ); |
|
232 | +add_action('wp_enqueue_scripts', 'twentyfifteen_header_background_color_css', 11); |
|
233 | 233 | |
234 | 234 | /** |
235 | 235 | * Enqueues front-end CSS for the sidebar text color. |
@@ -239,18 +239,18 @@ discard block |
||
239 | 239 | function twentyfifteen_sidebar_text_color_css() { |
240 | 240 | $color_scheme = twentyfifteen_get_color_scheme(); |
241 | 241 | $default_color = $color_scheme[4]; |
242 | - $sidebar_link_color = get_theme_mod( 'sidebar_textcolor', $default_color ); |
|
242 | + $sidebar_link_color = get_theme_mod('sidebar_textcolor', $default_color); |
|
243 | 243 | |
244 | 244 | // Don't do anything if the current color is the default. |
245 | - if ( $sidebar_link_color === $default_color ) { |
|
245 | + if ($sidebar_link_color === $default_color) { |
|
246 | 246 | return; |
247 | 247 | } |
248 | 248 | |
249 | 249 | // If we get this far, we have custom styles. Let's do this. |
250 | - $sidebar_link_color_rgb = twentyfifteen_hex2rgb( $sidebar_link_color ); |
|
251 | - $sidebar_text_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $sidebar_link_color_rgb ); |
|
252 | - $sidebar_border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $sidebar_link_color_rgb ); |
|
253 | - $sidebar_border_focus_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $sidebar_link_color_rgb ); |
|
250 | + $sidebar_link_color_rgb = twentyfifteen_hex2rgb($sidebar_link_color); |
|
251 | + $sidebar_text_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $sidebar_link_color_rgb); |
|
252 | + $sidebar_border_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $sidebar_link_color_rgb); |
|
253 | + $sidebar_border_focus_color = vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $sidebar_link_color_rgb); |
|
254 | 254 | |
255 | 255 | $css = ' |
256 | 256 | /* Custom Sidebar Text Color */ |
@@ -365,6 +365,6 @@ discard block |
||
365 | 365 | } |
366 | 366 | '; |
367 | 367 | |
368 | - wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color ) ); |
|
368 | + wp_add_inline_style('twentyfifteen-style', sprintf($css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color)); |
|
369 | 369 | } |
370 | -add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 ); |
|
370 | +add_action('wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Custom template tags for Twenty Fifteen |
|
4 | - * |
|
5 | - * Eventually, some of the functionality here could be replaced by core features. |
|
6 | - * |
|
7 | - * @package WordPress |
|
8 | - * @subpackage Twenty_Fifteen |
|
9 | - * @since Twenty Fifteen 1.0 |
|
10 | - */ |
|
3 | + * Custom template tags for Twenty Fifteen |
|
4 | + * |
|
5 | + * Eventually, some of the functionality here could be replaced by core features. |
|
6 | + * |
|
7 | + * @package WordPress |
|
8 | + * @subpackage Twenty_Fifteen |
|
9 | + * @since Twenty Fifteen 1.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) : |
13 | 13 | /** |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since Twenty Fifteen 1.0 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) : |
|
12 | +if ( ! function_exists('twentyfifteen_comment_nav')) : |
|
13 | 13 | /** |
14 | 14 | * Display navigation to next/previous comments when applicable. |
15 | 15 | * |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function twentyfifteen_comment_nav() { |
19 | 19 | // Are there comments to navigate through? |
20 | - if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : |
|
20 | + if (get_comment_pages_count() > 1 && get_option('page_comments')) : |
|
21 | 21 | ?> |
22 | 22 | <nav class="navigation comment-navigation" role="navigation"> |
23 | - <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2> |
|
23 | + <h2 class="screen-reader-text"><?php _e('Comment navigation', 'twentyfifteen'); ?></h2> |
|
24 | 24 | <div class="nav-links"> |
25 | 25 | <?php |
26 | - if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) : |
|
27 | - printf( '<div class="nav-previous">%s</div>', $prev_link ); |
|
26 | + if ($prev_link = get_previous_comments_link(__('Older Comments', 'twentyfifteen'))) : |
|
27 | + printf('<div class="nav-previous">%s</div>', $prev_link); |
|
28 | 28 | endif; |
29 | 29 | |
30 | - if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) : |
|
31 | - printf( '<div class="nav-next">%s</div>', $next_link ); |
|
30 | + if ($next_link = get_next_comments_link(__('Newer Comments', 'twentyfifteen'))) : |
|
31 | + printf('<div class="nav-next">%s</div>', $next_link); |
|
32 | 32 | endif; |
33 | 33 | ?> |
34 | 34 | </div><!-- .nav-links --> |
@@ -38,89 +38,89 @@ discard block |
||
38 | 38 | } |
39 | 39 | endif; |
40 | 40 | |
41 | -if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) : |
|
41 | +if ( ! function_exists('twentyfifteen_entry_meta')) : |
|
42 | 42 | /** |
43 | 43 | * Prints HTML with meta information for the categories, tags. |
44 | 44 | * |
45 | 45 | * @since Twenty Fifteen 1.0 |
46 | 46 | */ |
47 | 47 | function twentyfifteen_entry_meta() { |
48 | - if ( is_sticky() && is_home() && ! is_paged() ) { |
|
49 | - printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) ); |
|
48 | + if (is_sticky() && is_home() && ! is_paged()) { |
|
49 | + printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen')); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $format = get_post_format(); |
53 | - if ( current_theme_supports( 'post-formats', $format ) ) { |
|
54 | - printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', |
|
55 | - sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ), |
|
56 | - esc_url( get_post_format_link( $format ) ), |
|
57 | - get_post_format_string( $format ) |
|
53 | + if (current_theme_supports('post-formats', $format)) { |
|
54 | + printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', |
|
55 | + sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), |
|
56 | + esc_url(get_post_format_link($format)), |
|
57 | + get_post_format_string($format) |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | |
61 | - if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { |
|
61 | + if (in_array(get_post_type(), array('post', 'attachment'))) { |
|
62 | 62 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
63 | 63 | |
64 | - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { |
|
64 | + if (get_the_time('U') !== get_the_modified_time('U')) { |
|
65 | 65 | $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; |
66 | 66 | } |
67 | 67 | |
68 | - $time_string = sprintf( $time_string, |
|
69 | - esc_attr( get_the_date( 'c' ) ), |
|
68 | + $time_string = sprintf($time_string, |
|
69 | + esc_attr(get_the_date('c')), |
|
70 | 70 | get_the_date(), |
71 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
71 | + esc_attr(get_the_modified_date('c')), |
|
72 | 72 | get_the_modified_date() |
73 | 73 | ); |
74 | 74 | |
75 | - printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
76 | - _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ), |
|
77 | - esc_url( get_permalink() ), |
|
75 | + printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
76 | + _x('Posted on', 'Used before publish date.', 'twentyfifteen'), |
|
77 | + esc_url(get_permalink()), |
|
78 | 78 | $time_string |
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
82 | - if ( 'post' == get_post_type() ) { |
|
83 | - if ( is_singular() || is_multi_author() ) { |
|
84 | - printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', |
|
85 | - _x( 'Author', 'Used before post author name.', 'twentyfifteen' ), |
|
86 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
82 | + if ('post' == get_post_type()) { |
|
83 | + if (is_singular() || is_multi_author()) { |
|
84 | + printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', |
|
85 | + _x('Author', 'Used before post author name.', 'twentyfifteen'), |
|
86 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
87 | 87 | get_the_author() |
88 | 88 | ); |
89 | 89 | } |
90 | 90 | |
91 | - $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); |
|
92 | - if ( $categories_list && twentyfifteen_categorized_blog() ) { |
|
93 | - printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
|
94 | - _x( 'Categories', 'Used before category names.', 'twentyfifteen' ), |
|
91 | + $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); |
|
92 | + if ($categories_list && twentyfifteen_categorized_blog()) { |
|
93 | + printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
|
94 | + _x('Categories', 'Used before category names.', 'twentyfifteen'), |
|
95 | 95 | $categories_list |
96 | 96 | ); |
97 | 97 | } |
98 | 98 | |
99 | - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); |
|
100 | - if ( $tags_list ) { |
|
101 | - printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
|
102 | - _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ), |
|
99 | + $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); |
|
100 | + if ($tags_list) { |
|
101 | + printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
|
102 | + _x('Tags', 'Used before tag names.', 'twentyfifteen'), |
|
103 | 103 | $tags_list |
104 | 104 | ); |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - if ( is_attachment() && wp_attachment_is_image() ) { |
|
108 | + if (is_attachment() && wp_attachment_is_image()) { |
|
109 | 109 | // Retrieve attachment metadata. |
110 | 110 | $metadata = wp_get_attachment_metadata(); |
111 | 111 | |
112 | - printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', |
|
113 | - _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ), |
|
114 | - esc_url( wp_get_attachment_url() ), |
|
112 | + printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', |
|
113 | + _x('Full size', 'Used before full size attachment link.', 'twentyfifteen'), |
|
114 | + esc_url(wp_get_attachment_url()), |
|
115 | 115 | $metadata['width'], |
116 | 116 | $metadata['height'] |
117 | 117 | ); |
118 | 118 | } |
119 | 119 | |
120 | - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { |
|
120 | + if ( ! is_single() && ! post_password_required() && (comments_open() || get_comments_number())) { |
|
121 | 121 | echo '<span class="comments-link">'; |
122 | 122 | /* translators: %s: post title */ |
123 | - comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) ); |
|
123 | + comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen'), get_the_title())); |
|
124 | 124 | echo '</span>'; |
125 | 125 | } |
126 | 126 | } |
@@ -134,23 +134,23 @@ discard block |
||
134 | 134 | * @return bool True of there is more than one category, false otherwise. |
135 | 135 | */ |
136 | 136 | function twentyfifteen_categorized_blog() { |
137 | - if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) { |
|
137 | + if (false === ($all_the_cool_cats = get_transient('twentyfifteen_categories'))) { |
|
138 | 138 | // Create an array of all the categories that are attached to posts. |
139 | - $all_the_cool_cats = get_categories( array( |
|
139 | + $all_the_cool_cats = get_categories(array( |
|
140 | 140 | 'fields' => 'ids', |
141 | 141 | 'hide_empty' => 1, |
142 | 142 | |
143 | 143 | // We only need to know if there is more than one category. |
144 | 144 | 'number' => 2, |
145 | - ) ); |
|
145 | + )); |
|
146 | 146 | |
147 | 147 | // Count the number of categories that are attached to the posts. |
148 | - $all_the_cool_cats = count( $all_the_cool_cats ); |
|
148 | + $all_the_cool_cats = count($all_the_cool_cats); |
|
149 | 149 | |
150 | - set_transient( 'twentyfifteen_categories', $all_the_cool_cats ); |
|
150 | + set_transient('twentyfifteen_categories', $all_the_cool_cats); |
|
151 | 151 | } |
152 | 152 | |
153 | - if ( $all_the_cool_cats > 1 ) { |
|
153 | + if ($all_the_cool_cats > 1) { |
|
154 | 154 | // This blog has more than 1 category so twentyfifteen_categorized_blog should return true. |
155 | 155 | return true; |
156 | 156 | } else { |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | */ |
167 | 167 | function twentyfifteen_category_transient_flusher() { |
168 | 168 | // Like, beat it. Dig? |
169 | - delete_transient( 'twentyfifteen_categories' ); |
|
169 | + delete_transient('twentyfifteen_categories'); |
|
170 | 170 | } |
171 | -add_action( 'edit_category', 'twentyfifteen_category_transient_flusher' ); |
|
172 | -add_action( 'save_post', 'twentyfifteen_category_transient_flusher' ); |
|
171 | +add_action('edit_category', 'twentyfifteen_category_transient_flusher'); |
|
172 | +add_action('save_post', 'twentyfifteen_category_transient_flusher'); |
|
173 | 173 | |
174 | -if ( ! function_exists( 'twentyfifteen_post_thumbnail' ) ) : |
|
174 | +if ( ! function_exists('twentyfifteen_post_thumbnail')) : |
|
175 | 175 | /** |
176 | 176 | * Display an optional post thumbnail. |
177 | 177 | * |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | * @since Twenty Fifteen 1.0 |
182 | 182 | */ |
183 | 183 | function twentyfifteen_post_thumbnail() { |
184 | - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { |
|
184 | + if (post_password_required() || is_attachment() || ! has_post_thumbnail()) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - if ( is_singular() ) : |
|
188 | + if (is_singular()) : |
|
189 | 189 | ?> |
190 | 190 | |
191 | 191 | <div class="post-thumbnail"> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> |
198 | 198 | <?php |
199 | - the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); |
|
199 | + the_post_thumbnail('post-thumbnail', array('alt' => get_the_title())); |
|
200 | 200 | ?> |
201 | 201 | </a> |
202 | 202 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | endif; |
206 | 206 | |
207 | -if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) : |
|
207 | +if ( ! function_exists('twentyfifteen_get_link_url')) : |
|
208 | 208 | /** |
209 | 209 | * Return the post URL. |
210 | 210 | * |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | * @return string The Link format URL. |
218 | 218 | */ |
219 | 219 | function twentyfifteen_get_link_url() { |
220 | - $has_url = get_url_in_content( get_the_content() ); |
|
220 | + $has_url = get_url_in_content(get_the_content()); |
|
221 | 221 | |
222 | - return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); |
|
222 | + return $has_url ? $has_url : apply_filters('the_permalink', get_permalink()); |
|
223 | 223 | } |
224 | 224 | endif; |
225 | 225 | |
226 | -if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) : |
|
226 | +if ( ! function_exists('twentyfifteen_excerpt_more') && ! is_admin()) : |
|
227 | 227 | /** |
228 | 228 | * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link. |
229 | 229 | * |
@@ -231,13 +231,13 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return string 'Continue reading' link prepended with an ellipsis. |
233 | 233 | */ |
234 | -function twentyfifteen_excerpt_more( $more ) { |
|
235 | - $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', |
|
236 | - esc_url( get_permalink( get_the_ID() ) ), |
|
234 | +function twentyfifteen_excerpt_more($more) { |
|
235 | + $link = sprintf('<a href="%1$s" class="more-link">%2$s</a>', |
|
236 | + esc_url(get_permalink(get_the_ID())), |
|
237 | 237 | /* translators: %s: Name of current post */ |
238 | - sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) |
|
238 | + sprintf(__('Continue reading %s', 'twentyfifteen'), '<span class="screen-reader-text">'.get_the_title(get_the_ID()).'</span>') |
|
239 | 239 | ); |
240 | - return ' … ' . $link; |
|
240 | + return ' … '.$link; |
|
241 | 241 | } |
242 | -add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' ); |
|
242 | +add_filter('excerpt_more', 'twentyfifteen_excerpt_more'); |
|
243 | 243 | endif; |
@@ -192,9 +192,12 @@ |
||
192 | 192 | <?php the_post_thumbnail(); ?> |
193 | 193 | </div><!-- .post-thumbnail --> |
194 | 194 | |
195 | - <?php else : ?> |
|
195 | + <?php else { |
|
196 | + : ?> |
|
196 | 197 | |
197 | - <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> |
|
198 | + <a class="post-thumbnail" href="<?php the_permalink(); |
|
199 | +} |
|
200 | +?>" aria-hidden="true"> |
|
198 | 201 | <?php |
199 | 202 | the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); |
200 | 203 | ?> |
@@ -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,60 +14,60 @@ 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 | 23 | // Add color scheme setting and control. |
24 | - $wp_customize->add_setting( 'color_scheme', array( |
|
24 | + $wp_customize->add_setting('color_scheme', array( |
|
25 | 25 | 'default' => 'default', |
26 | 26 | 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', |
27 | 27 | 'transport' => 'postMessage', |
28 | - ) ); |
|
28 | + )); |
|
29 | 29 | |
30 | - $wp_customize->add_control( 'color_scheme', array( |
|
31 | - 'label' => __( 'Base Color Scheme', 'twentyfifteen' ), |
|
30 | + $wp_customize->add_control('color_scheme', array( |
|
31 | + 'label' => __('Base Color Scheme', 'twentyfifteen'), |
|
32 | 32 | 'section' => 'colors', |
33 | 33 | 'type' => 'select', |
34 | 34 | 'choices' => twentyfifteen_get_color_scheme_choices(), |
35 | 35 | 'priority' => 1, |
36 | - ) ); |
|
36 | + )); |
|
37 | 37 | |
38 | 38 | // Add custom header and sidebar text color setting and control. |
39 | - $wp_customize->add_setting( 'sidebar_textcolor', array( |
|
39 | + $wp_customize->add_setting('sidebar_textcolor', array( |
|
40 | 40 | 'default' => $color_scheme[4], |
41 | 41 | 'sanitize_callback' => 'sanitize_hex_color', |
42 | 42 | 'transport' => 'postMessage', |
43 | - ) ); |
|
43 | + )); |
|
44 | 44 | |
45 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_textcolor', array( |
|
46 | - 'label' => __( 'Header and Sidebar Text Color', 'twentyfifteen' ), |
|
47 | - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), |
|
45 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'sidebar_textcolor', array( |
|
46 | + 'label' => __('Header and Sidebar Text Color', 'twentyfifteen'), |
|
47 | + 'description' => __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'), |
|
48 | 48 | 'section' => 'colors', |
49 | - ) ) ); |
|
49 | + ))); |
|
50 | 50 | |
51 | 51 | // Remove the core header textcolor control, as it shares the sidebar text color. |
52 | - $wp_customize->remove_control( 'header_textcolor' ); |
|
52 | + $wp_customize->remove_control('header_textcolor'); |
|
53 | 53 | |
54 | 54 | // Add custom header and sidebar background color setting and control. |
55 | - $wp_customize->add_setting( 'header_background_color', array( |
|
55 | + $wp_customize->add_setting('header_background_color', array( |
|
56 | 56 | 'default' => $color_scheme[1], |
57 | 57 | 'sanitize_callback' => 'sanitize_hex_color', |
58 | 58 | 'transport' => 'postMessage', |
59 | - ) ); |
|
59 | + )); |
|
60 | 60 | |
61 | - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array( |
|
62 | - 'label' => __( 'Header and Sidebar Background Color', 'twentyfifteen' ), |
|
63 | - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), |
|
61 | + $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array( |
|
62 | + 'label' => __('Header and Sidebar Background Color', 'twentyfifteen'), |
|
63 | + 'description' => __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'), |
|
64 | 64 | 'section' => 'colors', |
65 | - ) ) ); |
|
65 | + ))); |
|
66 | 66 | |
67 | 67 | // Add an additional description to the header image section. |
68 | - $wp_customize->get_section( 'header_image' )->description = __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ); |
|
68 | + $wp_customize->get_section('header_image')->description = __('Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen'); |
|
69 | 69 | } |
70 | -add_action( 'customize_register', 'twentyfifteen_customize_register', 11 ); |
|
70 | +add_action('customize_register', 'twentyfifteen_customize_register', 11); |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Register color schemes for Twenty Fifteen. |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @return array An associative array of color scheme options. |
88 | 88 | */ |
89 | 89 | function twentyfifteen_get_color_schemes() { |
90 | - return apply_filters( 'twentyfifteen_color_schemes', array( |
|
90 | + return apply_filters('twentyfifteen_color_schemes', array( |
|
91 | 91 | 'default' => array( |
92 | - 'label' => __( 'Default', 'twentyfifteen' ), |
|
92 | + 'label' => __('Default', 'twentyfifteen'), |
|
93 | 93 | 'colors' => array( |
94 | 94 | '#f1f1f1', |
95 | 95 | '#ffffff', |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ), |
101 | 101 | ), |
102 | 102 | 'dark' => array( |
103 | - 'label' => __( 'Dark', 'twentyfifteen' ), |
|
103 | + 'label' => __('Dark', 'twentyfifteen'), |
|
104 | 104 | 'colors' => array( |
105 | 105 | '#111111', |
106 | 106 | '#202020', |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | ), |
112 | 112 | ), |
113 | 113 | 'yellow' => array( |
114 | - 'label' => __( 'Yellow', 'twentyfifteen' ), |
|
114 | + 'label' => __('Yellow', 'twentyfifteen'), |
|
115 | 115 | 'colors' => array( |
116 | 116 | '#f4ca16', |
117 | 117 | '#ffdf00', |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ), |
123 | 123 | ), |
124 | 124 | 'pink' => array( |
125 | - 'label' => __( 'Pink', 'twentyfifteen' ), |
|
125 | + 'label' => __('Pink', 'twentyfifteen'), |
|
126 | 126 | 'colors' => array( |
127 | 127 | '#ffe5d1', |
128 | 128 | '#e53b51', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ), |
134 | 134 | ), |
135 | 135 | 'purple' => array( |
136 | - 'label' => __( 'Purple', 'twentyfifteen' ), |
|
136 | + 'label' => __('Purple', 'twentyfifteen'), |
|
137 | 137 | 'colors' => array( |
138 | 138 | '#674970', |
139 | 139 | '#2e2256', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | ), |
145 | 145 | ), |
146 | 146 | 'blue' => array( |
147 | - 'label' => __( 'Blue', 'twentyfifteen' ), |
|
147 | + 'label' => __('Blue', 'twentyfifteen'), |
|
148 | 148 | 'colors' => array( |
149 | 149 | '#e9f2f9', |
150 | 150 | '#55c3dc', |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | '#f1f1f1', |
155 | 155 | ), |
156 | 156 | ), |
157 | - ) ); |
|
157 | + )); |
|
158 | 158 | } |
159 | 159 | |
160 | -if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) : |
|
160 | +if ( ! function_exists('twentyfifteen_get_color_scheme')) : |
|
161 | 161 | /** |
162 | 162 | * Get the current Twenty Fifteen color scheme. |
163 | 163 | * |
@@ -166,18 +166,18 @@ discard block |
||
166 | 166 | * @return array An associative array of either the current or default color scheme hex values. |
167 | 167 | */ |
168 | 168 | function twentyfifteen_get_color_scheme() { |
169 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
169 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
170 | 170 | $color_schemes = twentyfifteen_get_color_schemes(); |
171 | 171 | |
172 | - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { |
|
173 | - return $color_schemes[ $color_scheme_option ]['colors']; |
|
172 | + if (array_key_exists($color_scheme_option, $color_schemes)) { |
|
173 | + return $color_schemes[$color_scheme_option]['colors']; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | return $color_schemes['default']['colors']; |
177 | 177 | } |
178 | 178 | endif; // twentyfifteen_get_color_scheme |
179 | 179 | |
180 | -if ( ! function_exists( 'twentyfifteen_get_color_scheme_choices' ) ) : |
|
180 | +if ( ! function_exists('twentyfifteen_get_color_scheme_choices')) : |
|
181 | 181 | /** |
182 | 182 | * Returns an array of color scheme choices registered for Twenty Fifteen. |
183 | 183 | * |
@@ -189,15 +189,15 @@ discard block |
||
189 | 189 | $color_schemes = twentyfifteen_get_color_schemes(); |
190 | 190 | $color_scheme_control_options = array(); |
191 | 191 | |
192 | - foreach ( $color_schemes as $color_scheme => $value ) { |
|
193 | - $color_scheme_control_options[ $color_scheme ] = $value['label']; |
|
192 | + foreach ($color_schemes as $color_scheme => $value) { |
|
193 | + $color_scheme_control_options[$color_scheme] = $value['label']; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | return $color_scheme_control_options; |
197 | 197 | } |
198 | 198 | endif; // twentyfifteen_get_color_scheme_choices |
199 | 199 | |
200 | -if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) : |
|
200 | +if ( ! function_exists('twentyfifteen_sanitize_color_scheme')) : |
|
201 | 201 | /** |
202 | 202 | * Sanitization callback for color schemes. |
203 | 203 | * |
@@ -206,10 +206,10 @@ discard block |
||
206 | 206 | * @param string $value Color scheme name value. |
207 | 207 | * @return string Color scheme name. |
208 | 208 | */ |
209 | -function twentyfifteen_sanitize_color_scheme( $value ) { |
|
209 | +function twentyfifteen_sanitize_color_scheme($value) { |
|
210 | 210 | $color_schemes = twentyfifteen_get_color_scheme_choices(); |
211 | 211 | |
212 | - if ( ! array_key_exists( $value, $color_schemes ) ) { |
|
212 | + if ( ! array_key_exists($value, $color_schemes)) { |
|
213 | 213 | $value = 'default'; |
214 | 214 | } |
215 | 215 | |
@@ -225,38 +225,38 @@ discard block |
||
225 | 225 | * @see wp_add_inline_style() |
226 | 226 | */ |
227 | 227 | function twentyfifteen_color_scheme_css() { |
228 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
228 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
229 | 229 | |
230 | 230 | // Don't do anything if the default color scheme is selected. |
231 | - if ( 'default' === $color_scheme_option ) { |
|
231 | + if ('default' === $color_scheme_option) { |
|
232 | 232 | return; |
233 | 233 | } |
234 | 234 | |
235 | 235 | $color_scheme = twentyfifteen_get_color_scheme(); |
236 | 236 | |
237 | 237 | // Convert main and sidebar text hex color to rgba. |
238 | - $color_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[3] ); |
|
239 | - $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[4] ); |
|
238 | + $color_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[3]); |
|
239 | + $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb($color_scheme[4]); |
|
240 | 240 | $colors = array( |
241 | 241 | 'background_color' => $color_scheme[0], |
242 | 242 | 'header_background_color' => $color_scheme[1], |
243 | 243 | 'box_background_color' => $color_scheme[2], |
244 | 244 | 'textcolor' => $color_scheme[3], |
245 | - 'secondary_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb ), |
|
246 | - 'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb ), |
|
247 | - 'border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb ), |
|
245 | + 'secondary_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_textcolor_rgb), |
|
246 | + 'border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_textcolor_rgb), |
|
247 | + 'border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_textcolor_rgb), |
|
248 | 248 | 'sidebar_textcolor' => $color_scheme[4], |
249 | - 'sidebar_border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb ), |
|
250 | - 'sidebar_border_focus_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb ), |
|
251 | - 'secondary_sidebar_textcolor' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb ), |
|
249 | + 'sidebar_border_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.1)', $color_sidebar_textcolor_rgb), |
|
250 | + 'sidebar_border_focus_color' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.3)', $color_sidebar_textcolor_rgb), |
|
251 | + 'secondary_sidebar_textcolor' => vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $color_sidebar_textcolor_rgb), |
|
252 | 252 | 'meta_box_background_color' => $color_scheme[5], |
253 | 253 | ); |
254 | 254 | |
255 | - $color_scheme_css = twentyfifteen_get_color_scheme_css( $colors ); |
|
255 | + $color_scheme_css = twentyfifteen_get_color_scheme_css($colors); |
|
256 | 256 | |
257 | - wp_add_inline_style( 'twentyfifteen-style', $color_scheme_css ); |
|
257 | + wp_add_inline_style('twentyfifteen-style', $color_scheme_css); |
|
258 | 258 | } |
259 | -add_action( 'wp_enqueue_scripts', 'twentyfifteen_color_scheme_css' ); |
|
259 | +add_action('wp_enqueue_scripts', 'twentyfifteen_color_scheme_css'); |
|
260 | 260 | |
261 | 261 | /** |
262 | 262 | * Binds JS listener to make Customizer color_scheme control. |
@@ -266,10 +266,10 @@ discard block |
||
266 | 266 | * @since Twenty Fifteen 1.0 |
267 | 267 | */ |
268 | 268 | function twentyfifteen_customize_control_js() { |
269 | - wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20141216', true ); |
|
270 | - wp_localize_script( 'color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes() ); |
|
269 | + wp_enqueue_script('color-scheme-control', get_template_directory_uri().'/js/color-scheme-control.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), '20141216', true); |
|
270 | + wp_localize_script('color-scheme-control', 'colorScheme', twentyfifteen_get_color_schemes()); |
|
271 | 271 | } |
272 | -add_action( 'customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js' ); |
|
272 | +add_action('customize_controls_enqueue_scripts', 'twentyfifteen_customize_control_js'); |
|
273 | 273 | |
274 | 274 | /** |
275 | 275 | * Binds JS handlers to make the Customizer preview reload changes asynchronously. |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | * @since Twenty Fifteen 1.0 |
278 | 278 | */ |
279 | 279 | function twentyfifteen_customize_preview_js() { |
280 | - wp_enqueue_script( 'twentyfifteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20141216', true ); |
|
280 | + wp_enqueue_script('twentyfifteen-customize-preview', get_template_directory_uri().'/js/customize-preview.js', array('customize-preview'), '20141216', true); |
|
281 | 281 | } |
282 | -add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' ); |
|
282 | +add_action('customize_preview_init', 'twentyfifteen_customize_preview_js'); |
|
283 | 283 | |
284 | 284 | /** |
285 | 285 | * Returns CSS for the color schemes. |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | * @param array $colors Color scheme colors. |
290 | 290 | * @return string Color scheme CSS. |
291 | 291 | */ |
292 | -function twentyfifteen_get_color_scheme_css( $colors ) { |
|
293 | - $colors = wp_parse_args( $colors, array( |
|
292 | +function twentyfifteen_get_color_scheme_css($colors) { |
|
293 | + $colors = wp_parse_args($colors, array( |
|
294 | 294 | 'background_color' => '', |
295 | 295 | 'header_background_color' => '', |
296 | 296 | 'box_background_color' => '', |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | 'sidebar_border_focus_color' => '', |
304 | 304 | 'secondary_sidebar_textcolor' => '', |
305 | 305 | 'meta_box_background_color' => '', |
306 | - ) ); |
|
306 | + )); |
|
307 | 307 | |
308 | 308 | $css = <<<CSS |
309 | 309 | /* Color Scheme */ |
@@ -708,8 +708,8 @@ discard block |
||
708 | 708 | ); |
709 | 709 | ?> |
710 | 710 | <script type="text/html" id="tmpl-twentyfifteen-color-scheme"> |
711 | - <?php echo twentyfifteen_get_color_scheme_css( $colors ); ?> |
|
711 | + <?php echo twentyfifteen_get_color_scheme_css($colors); ?> |
|
712 | 712 | </script> |
713 | 713 | <?php |
714 | 714 | } |
715 | -add_action( 'customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template' ); |
|
715 | +add_action('customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template'); |
@@ -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 |
@@ -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,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 |
@@ -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 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(); ?>> |
@@ -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-## --> |