diff options
author | Yury German <blueknight@gentoo.org> | 2019-04-28 18:30:29 -0400 |
---|---|---|
committer | Yury German <blueknight@gentoo.org> | 2019-04-28 18:30:29 -0400 |
commit | 4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e (patch) | |
tree | 171fddc56d74d8492ffb703f04543896b6344243 /themes/twentysixteen | |
parent | Updating packages for 5.1.1 (diff) | |
download | blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.tar.gz blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.tar.bz2 blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.zip |
Updating the themes
Updated themes. The followng themes updated:
Mantra - 3.0.5 => 3.1.0, Twenty Fifteen 2.2 => 2.4
Twenty Fourteen 2.4 => 2.6, Twenty Sixteen 1.7 => 1.9
Signed-off-by: Yury German <blueknight@gentoo.org>
Diffstat (limited to 'themes/twentysixteen')
21 files changed, 1015 insertions, 812 deletions
diff --git a/themes/twentysixteen/archive.php b/themes/twentysixteen/archive.php index bdd2967e..079730f3 100644 --- a/themes/twentysixteen/archive.php +++ b/themes/twentysixteen/archive.php @@ -9,7 +9,7 @@ * new template file for each one. For example, tag.php (Tag archives), * category.php (Category archives), author.php (Author archives), etc. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Sixteen @@ -32,7 +32,8 @@ get_header(); ?> <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -41,17 +42,19 @@ get_header(); ?> */ get_template_part( 'template-parts/content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/comments.php b/themes/twentysixteen/comments.php index 7ff5b32d..a0a29d57 100644 --- a/themes/twentysixteen/comments.php +++ b/themes/twentysixteen/comments.php @@ -26,23 +26,23 @@ if ( post_password_required() ) { <h2 class="comments-title"> <?php $comments_number = get_comments_number(); - if ( '1' === $comments_number ) { - /* translators: %s: post title */ - printf( _x( 'One thought on “%s”', 'comments title', 'twentysixteen' ), get_the_title() ); - } else { - printf( - /* translators: 1: number of comments, 2: post title */ - _nx( - '%1$s thought on “%2$s”', - '%1$s thoughts on “%2$s”', - $comments_number, - 'comments title', - 'twentysixteen' - ), - number_format_i18n( $comments_number ), - get_the_title() - ); - } + if ( '1' === $comments_number ) { + /* translators: %s: post title */ + printf( _x( 'One thought on “%s”', 'comments title', 'twentysixteen' ), get_the_title() ); + } else { + printf( + /* translators: 1: number of comments, 2: post title */ + _nx( + '%1$s thought on “%2$s”', + '%1$s thoughts on “%2$s”', + $comments_number, + 'comments title', + 'twentysixteen' + ), + number_format_i18n( $comments_number ), + get_the_title() + ); + } ?> </h2> @@ -50,11 +50,13 @@ if ( post_password_required() ) { <ol class="comment-list"> <?php - wp_list_comments( array( - 'style' => 'ol', - 'short_ping' => true, - 'avatar_size' => 42, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 42, + ) + ); ?> </ol><!-- .comment-list --> @@ -64,16 +66,18 @@ if ( post_password_required() ) { <?php // If comments are closed and there are comments, let's leave a little note, shall we? - if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : - ?> - <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> + if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : + ?> + <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> <?php endif; ?> <?php - comment_form( array( - 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', - 'title_reply_after' => '</h2>', - ) ); - ?> + comment_form( + array( + 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', + 'title_reply_after' => '</h2>', + ) + ); + ?> </div><!-- .comments-area --> diff --git a/themes/twentysixteen/css/blocks.css b/themes/twentysixteen/css/blocks.css index ae742241..9ddea807 100644 --- a/themes/twentysixteen/css/blocks.css +++ b/themes/twentysixteen/css/blocks.css @@ -232,13 +232,12 @@ p.has-drop-cap:not(:focus)::first-letter { /* Buttons */ .wp-block-button .wp-block-button__link { - border: 0; - border-radius: 2px; + box-shadow: none; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: 700; letter-spacing: 0.046875em; line-height: 1; - padding: 0.84375em 0.875em 0.78125em; + padding: 0.84375em 1.3125em 0.78125em; text-transform: uppercase; } @@ -247,8 +246,20 @@ p.has-drop-cap:not(:focus)::first-letter { color: #fff; } +.entry-content .is-style-outline .wp-block-button__link:not(.has-background) { + background: transparent; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #1a1a1a; +} + .entry-content .wp-block-button__link:hover, -.entry-content .wp-block-button__link:focus { +.entry-content .wp-block-button__link:focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):focus { background: #007acc; color: #fff; } diff --git a/themes/twentysixteen/css/editor-blocks.css b/themes/twentysixteen/css/editor-blocks.css index 802353bf..4bf8cbf5 100644 --- a/themes/twentysixteen/css/editor-blocks.css +++ b/themes/twentysixteen/css/editor-blocks.css @@ -543,18 +543,23 @@ Description: Used to style blocks in the editor. /* Buttons */ .wp-block-button .wp-block-button__link { - background: #1a1a1a; - border: 0; - border-radius: 2px; - color: #fff; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: 700; letter-spacing: 0.046875em; line-height: 1; - padding: 0.84375em 0.875em 0.78125em; + padding: 0.84375em 1.3125em 0.78125em; text-transform: uppercase; } +.wp-block-button__link { + background: #1a1a1a; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #1a1a1a; +} + /* Media & Text */ .wp-block-media-text *:last-child { diff --git a/themes/twentysixteen/footer.php b/themes/twentysixteen/footer.php index baa82092..5fff3bd9 100644 --- a/themes/twentysixteen/footer.php +++ b/themes/twentysixteen/footer.php @@ -16,10 +16,12 @@ <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'primary', - 'menu_class' => 'primary-menu', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'menu_class' => 'primary-menu', + ) + ); ?> </nav><!-- .main-navigation --> <?php endif; ?> @@ -27,13 +29,15 @@ <?php if ( has_nav_menu( 'social' ) ) : ?> <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'social', - 'menu_class' => 'social-links-menu', - 'depth' => 1, - 'link_before' => '<span class="screen-reader-text">', - 'link_after' => '</span>', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'menu_class' => 'social-links-menu', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>', + ) + ); ?> </nav><!-- .social-navigation --> <?php endif; ?> diff --git a/themes/twentysixteen/functions.php b/themes/twentysixteen/functions.php index 1bade4ca..2c47a2d2 100644 --- a/themes/twentysixteen/functions.php +++ b/themes/twentysixteen/functions.php @@ -33,173 +33,187 @@ if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) { } if ( ! function_exists( 'twentysixteen_setup' ) ) : -/** - * Sets up theme defaults and registers support for various WordPress features. - * - * Note that this function is hooked into the after_setup_theme hook, which - * runs before the init hook. The init hook is too late for some features, such - * as indicating support for post thumbnails. - * - * Create your own twentysixteen_setup() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_setup() { - /* - * Make theme available for translation. - * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen - * If you're building a theme based on Twenty Sixteen, use a find and replace - * to change 'twentysixteen' to the name of your theme in all the template files - */ - load_theme_textdomain( 'twentysixteen' ); - - // Add default posts and comments RSS feed links to head. - add_theme_support( 'automatic-feed-links' ); - - /* - * Let WordPress manage the document title. - * By adding theme support, we declare that this theme does not use a - * hard-coded <title> tag in the document head, and expect WordPress to - * provide it for us. - */ - add_theme_support( 'title-tag' ); - - /* - * Enable support for custom logo. + /** + * Sets up theme defaults and registers support for various WordPress features. * - * @since Twenty Sixteen 1.2 - */ - add_theme_support( 'custom-logo', array( - 'height' => 240, - 'width' => 240, - 'flex-height' => true, - ) ); - - /* - * Enable support for Post Thumbnails on posts and pages. + * Note that this function is hooked into the after_setup_theme hook, which + * runs before the init hook. The init hook is too late for some features, such + * as indicating support for post thumbnails. * - * @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails - */ - add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 1200, 9999 ); - - // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'primary' => __( 'Primary Menu', 'twentysixteen' ), - 'social' => __( 'Social Links Menu', 'twentysixteen' ), - ) ); - - /* - * Switch default core markup for search form, comment form, and comments - * to output valid HTML5. - */ - add_theme_support( 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); - - /* - * Enable support for Post Formats. + * Create your own twentysixteen_setup() function to override in a child theme. * - * See: https://codex.wordpress.org/Post_Formats - */ - add_theme_support( 'post-formats', array( - 'aside', - 'image', - 'video', - 'quote', - 'link', - 'gallery', - 'status', - 'audio', - 'chat', - ) ); - - /* - * This theme styles the visual editor to resemble the theme style, - * specifically font, colors, icons, and column width. + * @since Twenty Sixteen 1.0 */ - add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); - - // Load regular editor styles into the new block-based editor. - add_theme_support( 'editor-styles' ); - - // Load default block styles. - add_theme_support( 'wp-block-styles' ); - - // Add support for responsive embeds. - add_theme_support( 'responsive-embeds' ); - - // Add support for custom color scheme. - add_theme_support( 'editor-color-palette', array( - array( - 'name' => __( 'Dark Gray', 'twentysixteen' ), - 'slug' => 'dark-gray', - 'color' => '#1a1a1a', - ), - array( - 'name' => __( 'Medium Gray', 'twentysixteen' ), - 'slug' => 'medium-gray', - 'color' => '#686868', - ), - array( - 'name' => __( 'Light Gray', 'twentysixteen' ), - 'slug' => 'light-gray', - 'color' => '#e5e5e5', - ), - array( - 'name' => __( 'White', 'twentysixteen' ), - 'slug' => 'white', - 'color' => '#fff', - ), - array( - 'name' => __( 'Blue Gray', 'twentysixteen' ), - 'slug' => 'blue-gray', - 'color' => '#4d545c', - ), - array( - 'name' => __( 'Bright Blue', 'twentysixteen' ), - 'slug' => 'bright-blue', - 'color' => '#007acc', - ), - array( - 'name' => __( 'Light Blue', 'twentysixteen' ), - 'slug' => 'light-blue', - 'color' => '#9adffd', - ), - array( - 'name' => __( 'Dark Brown', 'twentysixteen' ), - 'slug' => 'dark-brown', - 'color' => '#402b30', - ), - array( - 'name' => __( 'Medium Brown', 'twentysixteen' ), - 'slug' => 'medium-brown', - 'color' => '#774e24', - ), - array( - 'name' => __( 'Dark Red', 'twentysixteen' ), - 'slug' => 'dark-red', - 'color' => '#640c1f', - ), - array( - 'name' => __( 'Bright Red', 'twentysixteen' ), - 'slug' => 'bright-red', - 'color' => '#ff675f', - ), - array( - 'name' => __( 'Yellow', 'twentysixteen' ), - 'slug' => 'yellow', - 'color' => '#ffef8e', - ), - ) ); - - // Indicate widget sidebars can use selective refresh in the Customizer. - add_theme_support( 'customize-selective-refresh-widgets' ); -} + function twentysixteen_setup() { + /* + * Make theme available for translation. + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen + * If you're building a theme based on Twenty Sixteen, use a find and replace + * to change 'twentysixteen' to the name of your theme in all the template files + */ + load_theme_textdomain( 'twentysixteen' ); + + // Add default posts and comments RSS feed links to head. + add_theme_support( 'automatic-feed-links' ); + + /* + * Let WordPress manage the document title. + * By adding theme support, we declare that this theme does not use a + * hard-coded <title> tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for custom logo. + * + * @since Twenty Sixteen 1.2 + */ + add_theme_support( + 'custom-logo', + array( + 'height' => 240, + 'width' => 240, + 'flex-height' => true, + ) + ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails + */ + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 1200, 9999 ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'primary' => __( 'Primary Menu', 'twentysixteen' ), + 'social' => __( 'Social Links Menu', 'twentysixteen' ), + ) + ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); + + /* + * Enable support for Post Formats. + * + * See: https://codex.wordpress.org/Post_Formats + */ + add_theme_support( + 'post-formats', + array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'status', + 'audio', + 'chat', + ) + ); + + /* + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, icons, and column width. + */ + add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); + + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Add support for custom color scheme. + add_theme_support( + 'editor-color-palette', + array( + array( + 'name' => __( 'Dark Gray', 'twentysixteen' ), + 'slug' => 'dark-gray', + 'color' => '#1a1a1a', + ), + array( + 'name' => __( 'Medium Gray', 'twentysixteen' ), + 'slug' => 'medium-gray', + 'color' => '#686868', + ), + array( + 'name' => __( 'Light Gray', 'twentysixteen' ), + 'slug' => 'light-gray', + 'color' => '#e5e5e5', + ), + array( + 'name' => __( 'White', 'twentysixteen' ), + 'slug' => 'white', + 'color' => '#fff', + ), + array( + 'name' => __( 'Blue Gray', 'twentysixteen' ), + 'slug' => 'blue-gray', + 'color' => '#4d545c', + ), + array( + 'name' => __( 'Bright Blue', 'twentysixteen' ), + 'slug' => 'bright-blue', + 'color' => '#007acc', + ), + array( + 'name' => __( 'Light Blue', 'twentysixteen' ), + 'slug' => 'light-blue', + 'color' => '#9adffd', + ), + array( + 'name' => __( 'Dark Brown', 'twentysixteen' ), + 'slug' => 'dark-brown', + 'color' => '#402b30', + ), + array( + 'name' => __( 'Medium Brown', 'twentysixteen' ), + 'slug' => 'medium-brown', + 'color' => '#774e24', + ), + array( + 'name' => __( 'Dark Red', 'twentysixteen' ), + 'slug' => 'dark-red', + 'color' => '#640c1f', + ), + array( + 'name' => __( 'Bright Red', 'twentysixteen' ), + 'slug' => 'bright-red', + 'color' => '#ff675f', + ), + array( + 'name' => __( 'Yellow', 'twentysixteen' ), + 'slug' => 'yellow', + 'color' => '#ffef8e', + ), + ) + ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); + } endif; // twentysixteen_setup add_action( 'after_setup_theme', 'twentysixteen_setup' ); @@ -218,6 +232,27 @@ function twentysixteen_content_width() { add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); /** + * Add preconnect for Google Fonts. + * + * @since Twenty Sixteen 1.6 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array $urls URLs to print for resource hints. + */ +function twentysixteen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentysixteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentysixteen_resource_hints', 10, 2 ); + +/** * Registers a widget area. * * @link https://developer.wordpress.org/reference/functions/register_sidebar/ @@ -225,77 +260,86 @@ add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); * @since Twenty Sixteen 1.0 */ function twentysixteen_widgets_init() { - register_sidebar( array( - 'name' => __( 'Sidebar', 'twentysixteen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); - - register_sidebar( array( - 'name' => __( 'Content Bottom 1', 'twentysixteen' ), - 'id' => 'sidebar-2', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); - - register_sidebar( array( - 'name' => __( 'Content Bottom 2', 'twentysixteen' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); + register_sidebar( + array( + 'name' => __( 'Sidebar', 'twentysixteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 1', 'twentysixteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 2', 'twentysixteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); } add_action( 'widgets_init', 'twentysixteen_widgets_init' ); if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : -/** - * Register Google fonts for Twenty Sixteen. - * - * Create your own twentysixteen_fonts_url() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return string Google fonts URL for the theme. - */ -function twentysixteen_fonts_url() { - $fonts_url = ''; - $fonts = array(); - $subsets = 'latin,latin-ext'; - - /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { - $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; - } + /** + * Register Google fonts for Twenty Sixteen. + * + * Create your own twentysixteen_fonts_url() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string Google fonts URL for the theme. + */ + function twentysixteen_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ + if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; + } - /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { - $fonts[] = 'Montserrat:400,700'; - } + /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ + if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Montserrat:400,700'; + } - /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { - $fonts[] = 'Inconsolata:400'; - } + /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ + if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Inconsolata:400'; + } - if ( $fonts ) { - $fonts_url = add_query_arg( array( - 'family' => urlencode( implode( '|', $fonts ) ), - 'subset' => urlencode( $subsets ), - ), 'https://fonts.googleapis.com/css' ); - } + if ( $fonts ) { + $fonts_url = add_query_arg( + array( + 'family' => urlencode( implode( '|', $fonts ) ), + 'subset' => urlencode( $subsets ), + ), + 'https://fonts.googleapis.com/css' + ); + } - return $fonts_url; -} + return $fonts_url; + } endif; /** @@ -326,7 +370,7 @@ function twentysixteen_scripts() { wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() ); // Theme block stylesheet. - wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20181018' ); + wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20181230' ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20160816' ); @@ -354,12 +398,16 @@ function twentysixteen_scripts() { wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' ); } - wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160816', true ); + wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20181230', true ); - wp_localize_script( 'twentysixteen-script', 'screenReaderText', array( - 'expand' => __( 'expand child menu', 'twentysixteen' ), - 'collapse' => __( 'collapse child menu', 'twentysixteen' ), - ) ); + wp_localize_script( + 'twentysixteen-script', + 'screenReaderText', + array( + 'expand' => __( 'expand child menu', 'twentysixteen' ), + 'collapse' => __( 'collapse child menu', 'twentysixteen' ), + ) + ); } add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); @@ -370,7 +418,7 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); */ function twentysixteen_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' ); + wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' ); // Add custom fonts. wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); } @@ -422,10 +470,10 @@ function twentysixteen_hex2rgb( $color ) { $color = trim( $color, '#' ); if ( strlen( $color ) === 3 ) { - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); - } else if ( strlen( $color ) === 6 ) { + $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); + $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); + $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); + } elseif ( strlen( $color ) === 6 ) { $r = hexdec( substr( $color, 0, 2 ) ); $g = hexdec( substr( $color, 2, 2 ) ); $b = hexdec( substr( $color, 4, 2 ) ); @@ -433,7 +481,11 @@ function twentysixteen_hex2rgb( $color ) { return array(); } - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); + return array( + 'red' => $r, + 'green' => $g, + 'blue' => $b, + ); } /** @@ -478,7 +530,7 @@ function twentysixteen_content_image_sizes_attr( $sizes, $size ) { return $sizes; } -add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10 , 2 ); +add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10, 2 ); /** * Add custom image sizes attribute to enhance responsive image functionality @@ -501,7 +553,7 @@ function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { } return $attr; } -add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10 , 3 ); +add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10, 3 ); /** * Modifies tag cloud widget arguments to display all tags in the same font size diff --git a/themes/twentysixteen/header.php b/themes/twentysixteen/header.php index d230c4f8..f264ac2c 100644 --- a/themes/twentysixteen/header.php +++ b/themes/twentysixteen/header.php @@ -16,7 +16,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?> - <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> + <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>"> <?php endif; ?> <?php wp_head(); ?> </head> @@ -35,10 +35,12 @@ <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php else : ?> <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> - <?php endif; + <?php + endif; $description = get_bloginfo( 'description', 'display' ); - if ( $description || is_customize_preview() ) : ?> + if ( $description || is_customize_preview() ) : + ?> <p class="site-description"><?php echo $description; ?></p> <?php endif; ?> </div><!-- .site-branding --> @@ -50,10 +52,12 @@ <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'primary', - 'menu_class' => 'primary-menu', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'menu_class' => 'primary-menu', + ) + ); ?> </nav><!-- .main-navigation --> <?php endif; ?> @@ -61,13 +65,15 @@ <?php if ( has_nav_menu( 'social' ) ) : ?> <nav id="social-navigation" class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'social', - 'menu_class' => 'social-links-menu', - 'depth' => 1, - 'link_before' => '<span class="screen-reader-text">', - 'link_after' => '</span>', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'menu_class' => 'social-links-menu', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>', + ) + ); ?> </nav><!-- .social-navigation --> <?php endif; ?> diff --git a/themes/twentysixteen/image.php b/themes/twentysixteen/image.php index 434b0b02..5fcbb901 100644 --- a/themes/twentysixteen/image.php +++ b/themes/twentysixteen/image.php @@ -14,93 +14,99 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); - ?> - - <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> + while ( have_posts() ) : + the_post(); + ?> - <nav id="image-navigation" class="navigation image-navigation"> - <div class="nav-links"> - <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentysixteen' ) ); ?></div> - <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></div> - </div><!-- .nav-links --> - </nav><!-- .image-navigation --> + <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> - <header class="entry-header"> - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> - </header><!-- .entry-header --> + <nav id="image-navigation" class="navigation image-navigation"> + <div class="nav-links"> + <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentysixteen' ) ); ?></div> + <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></div> + </div><!-- .nav-links --> + </nav><!-- .image-navigation --> - <div class="entry-content"> + <header class="entry-header"> + <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> + </header><!-- .entry-header --> - <div class="entry-attachment"> - <?php - /** - * Filter the default twentysixteen image attachment size. - * - * @since Twenty Sixteen 1.0 - * - * @param string $image_size Image size. Default 'large'. - */ - $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' ); + <div class="entry-content"> - echo wp_get_attachment_image( get_the_ID(), $image_size ); - ?> + <div class="entry-attachment"> + <?php + /** + * Filter the default twentysixteen image attachment size. + * + * @since Twenty Sixteen 1.0 + * + * @param string $image_size Image size. Default 'large'. + */ + $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' ); + + echo wp_get_attachment_image( get_the_ID(), $image_size ); + ?> - <?php twentysixteen_excerpt( 'entry-caption' ); ?> + <?php twentysixteen_excerpt( 'entry-caption' ); ?> </div><!-- .entry-attachment --> <?php - the_content(); - wp_link_pages( array( + the_content(); + wp_link_pages( + array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + ) + ); ?> </div><!-- .entry-content --> <footer class="entry-footer"> - <?php twentysixteen_entry_meta(); ?> + <?php twentysixteen_entry_meta(); ?> <?php - // Retrieve attachment metadata. - $metadata = wp_get_attachment_metadata(); - if ( $metadata ) { - printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', - esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), - esc_url( wp_get_attachment_url() ), - absint( $metadata['width'] ), - absint( $metadata['height'] ) - ); - } + // Retrieve attachment metadata. + $metadata = wp_get_attachment_metadata(); + if ( $metadata ) { + printf( + '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', + esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), + esc_url( wp_get_attachment_url() ), + absint( $metadata['width'] ), + absint( $metadata['height'] ) + ); + } ?> <?php - edit_post_link( - sprintf( - /* translators: %s: Name of current post */ - __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), - get_the_title() - ), - '<span class="edit-link">', - '</span>' - ); + edit_post_link( + sprintf( + /* translators: %s: Name of current post */ + __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), + get_the_title() + ), + '<span class="edit-link">', + '</span>' + ); ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> <?php - // If comments are open or we have at least one comment, load up the comment template. - if ( comments_open() || get_comments_number() ) { - comments_template(); - } - - // Parent post navigation. - the_post_navigation( array( + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + + // Parent post navigation. + the_post_navigation( + array( 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ), - ) ); + ) + ); // End the loop. endwhile; ?> diff --git a/themes/twentysixteen/inc/back-compat.php b/themes/twentysixteen/inc/back-compat.php index 7ed4240c..c97940e0 100644 --- a/themes/twentysixteen/inc/back-compat.php +++ b/themes/twentysixteen/inc/back-compat.php @@ -50,9 +50,13 @@ function twentysixteen_upgrade_notice() { * @global string $wp_version WordPress version. */ function twentysixteen_customize() { - wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentysixteen_customize' ); diff --git a/themes/twentysixteen/inc/customizer.php b/themes/twentysixteen/inc/customizer.php index 62eb1b0b..9867d3d9 100644 --- a/themes/twentysixteen/inc/customizer.php +++ b/themes/twentysixteen/inc/customizer.php @@ -30,9 +30,15 @@ function twentysixteen_custom_header_and_background() { * @type string $default-color Default color of the background. * } */ - add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array( - 'default-color' => $default_background_color, - ) ) ); + add_theme_support( + 'custom-background', + apply_filters( + 'twentysixteen_custom_background_args', + array( + 'default-color' => $default_background_color, + ) + ) + ); /** * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. @@ -50,35 +56,41 @@ function twentysixteen_custom_header_and_background() { * displayed on the blog. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array( - 'default-text-color' => $default_text_color, - 'width' => 1200, - 'height' => 280, - 'flex-height' => true, - 'wp-head-callback' => 'twentysixteen_header_style', - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + 'twentysixteen_custom_header_args', + array( + 'default-text-color' => $default_text_color, + 'width' => 1200, + 'height' => 280, + 'flex-height' => true, + 'wp-head-callback' => 'twentysixteen_header_style', + ) + ) + ); } add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); if ( ! function_exists( 'twentysixteen_header_style' ) ) : -/** - * Styles the header text displayed on the site. - * - * Create your own twentysixteen_header_style() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @see twentysixteen_custom_header_and_background(). - */ -function twentysixteen_header_style() { - // If the header text option is untouched, let's bail. - if ( display_header_text() ) { - return; - } + /** + * Styles the header text displayed on the site. + * + * Create your own twentysixteen_header_style() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @see twentysixteen_custom_header_and_background(). + */ + function twentysixteen_header_style() { + // If the header text option is untouched, let's bail. + if ( display_header_text() ) { + return; + } - // If the header text has been hidden. - ?> - <style type="text/css" id="twentysixteen-header-css"> + // If the header text has been hidden. + ?> + <style type="text/css" id="twentysixteen-header-css"> .site-branding { margin: 0 auto 0 0; } @@ -88,9 +100,9 @@ function twentysixteen_header_style() { clip: rect(1px, 1px, 1px, 1px); position: absolute; } - </style> - <?php -} + </style> + <?php + } endif; // twentysixteen_header_style /** @@ -103,87 +115,135 @@ endif; // twentysixteen_header_style function twentysixteen_customize_register( $wp_customize ) { $color_scheme = twentysixteen_get_color_scheme(); - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'container_inclusive' => false, - 'render_callback' => 'twentysixteen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentysixteen_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogdescription', + ) + ); } // Add color scheme setting and control. - $wp_customize->add_setting( 'color_scheme', array( - 'default' => 'default', - 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( 'color_scheme', array( - 'label' => __( 'Base Color Scheme', 'twentysixteen' ), - 'section' => 'colors', - 'type' => 'select', - 'choices' => twentysixteen_get_color_scheme_choices(), - 'priority' => 1, - ) ); + $wp_customize->add_setting( + 'color_scheme', + array( + 'default' => 'default', + 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'color_scheme', + array( + 'label' => __( 'Base Color Scheme', 'twentysixteen' ), + 'section' => 'colors', + 'type' => 'select', + 'choices' => twentysixteen_get_color_scheme_choices(), + 'priority' => 1, + ) + ); // Add page background color setting and control. - $wp_customize->add_setting( 'page_background_color', array( - 'default' => $color_scheme[1], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'page_background_color', + array( + 'default' => $color_scheme[1], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_background_color', array( - 'label' => __( 'Page Background Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'page_background_color', + array( + 'label' => __( 'Page Background Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Remove the core header textcolor control, as it shares the main text color. $wp_customize->remove_control( 'header_textcolor' ); // Add link color setting and control. - $wp_customize->add_setting( 'link_color', array( - 'default' => $color_scheme[2], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'link_color', + array( + 'default' => $color_scheme[2], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( - 'label' => __( 'Link Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'link_color', + array( + 'label' => __( 'Link Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add main text color setting and control. - $wp_customize->add_setting( 'main_text_color', array( - 'default' => $color_scheme[3], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'main_text_color', + array( + 'default' => $color_scheme[3], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array( - 'label' => __( 'Main Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'main_text_color', + array( + 'label' => __( 'Main Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add secondary text color setting and control. - $wp_customize->add_setting( 'secondary_text_color', array( - 'default' => $color_scheme[4], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array( - 'label' => __( 'Secondary Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_setting( + 'secondary_text_color', + array( + 'default' => $color_scheme[4], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'secondary_text_color', + array( + 'label' => __( 'Secondary Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); } add_action( 'customize_register', 'twentysixteen_customize_register', 11 ); @@ -248,127 +308,130 @@ function twentysixteen_get_color_schemes() { * } * } */ - return apply_filters( 'twentysixteen_color_schemes', array( - 'default' => array( - 'label' => __( 'Default', 'twentysixteen' ), - 'colors' => array( - '#1a1a1a', - '#ffffff', - '#007acc', - '#1a1a1a', - '#686868', + return apply_filters( + 'twentysixteen_color_schemes', + array( + 'default' => array( + 'label' => __( 'Default', 'twentysixteen' ), + 'colors' => array( + '#1a1a1a', + '#ffffff', + '#007acc', + '#1a1a1a', + '#686868', + ), ), - ), - 'dark' => array( - 'label' => __( 'Dark', 'twentysixteen' ), - 'colors' => array( - '#262626', - '#1a1a1a', - '#9adffd', - '#e5e5e5', - '#c1c1c1', + 'dark' => array( + 'label' => __( 'Dark', 'twentysixteen' ), + 'colors' => array( + '#262626', + '#1a1a1a', + '#9adffd', + '#e5e5e5', + '#c1c1c1', + ), ), - ), - 'gray' => array( - 'label' => __( 'Gray', 'twentysixteen' ), - 'colors' => array( - '#616a73', - '#4d545c', - '#c7c7c7', - '#f2f2f2', - '#f2f2f2', + 'gray' => array( + 'label' => __( 'Gray', 'twentysixteen' ), + 'colors' => array( + '#616a73', + '#4d545c', + '#c7c7c7', + '#f2f2f2', + '#f2f2f2', + ), ), - ), - 'red' => array( - 'label' => __( 'Red', 'twentysixteen' ), - 'colors' => array( - '#ffffff', - '#ff675f', - '#640c1f', - '#402b30', - '#402b30', + 'red' => array( + 'label' => __( 'Red', 'twentysixteen' ), + 'colors' => array( + '#ffffff', + '#ff675f', + '#640c1f', + '#402b30', + '#402b30', + ), ), - ), - 'yellow' => array( - 'label' => __( 'Yellow', 'twentysixteen' ), - 'colors' => array( - '#3b3721', - '#ffef8e', - '#774e24', - '#3b3721', - '#5b4d3e', + 'yellow' => array( + 'label' => __( 'Yellow', 'twentysixteen' ), + 'colors' => array( + '#3b3721', + '#ffef8e', + '#774e24', + '#3b3721', + '#5b4d3e', + ), ), - ), - ) ); + ) + ); } if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : -/** - * Retrieves the current Twenty Sixteen color scheme. - * - * Create your own twentysixteen_get_color_scheme() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array An associative array of either the current or default color scheme HEX values. - */ -function twentysixteen_get_color_scheme() { - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); - $color_schemes = twentysixteen_get_color_schemes(); + /** + * Retrieves the current Twenty Sixteen color scheme. + * + * Create your own twentysixteen_get_color_scheme() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array An associative array of either the current or default color scheme HEX values. + */ + function twentysixteen_get_color_scheme() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + $color_schemes = twentysixteen_get_color_schemes(); - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { - return $color_schemes[ $color_scheme_option ]['colors']; - } + if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { + return $color_schemes[ $color_scheme_option ]['colors']; + } - return $color_schemes['default']['colors']; -} + return $color_schemes['default']['colors']; + } endif; // twentysixteen_get_color_scheme if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) : -/** - * Retrieves an array of color scheme choices registered for Twenty Sixteen. - * - * Create your own twentysixteen_get_color_scheme_choices() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array Array of color schemes. - */ -function twentysixteen_get_color_scheme_choices() { - $color_schemes = twentysixteen_get_color_schemes(); - $color_scheme_control_options = array(); + /** + * Retrieves an array of color scheme choices registered for Twenty Sixteen. + * + * Create your own twentysixteen_get_color_scheme_choices() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array Array of color schemes. + */ + function twentysixteen_get_color_scheme_choices() { + $color_schemes = twentysixteen_get_color_schemes(); + $color_scheme_control_options = array(); - foreach ( $color_schemes as $color_scheme => $value ) { - $color_scheme_control_options[ $color_scheme ] = $value['label']; - } + foreach ( $color_schemes as $color_scheme => $value ) { + $color_scheme_control_options[ $color_scheme ] = $value['label']; + } - return $color_scheme_control_options; -} + return $color_scheme_control_options; + } endif; // twentysixteen_get_color_scheme_choices if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) : -/** - * Handles sanitization for Twenty Sixteen color schemes. - * - * Create your own twentysixteen_sanitize_color_scheme() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @param string $value Color scheme name value. - * @return string Color scheme name. - */ -function twentysixteen_sanitize_color_scheme( $value ) { - $color_schemes = twentysixteen_get_color_scheme_choices(); + /** + * Handles sanitization for Twenty Sixteen color schemes. + * + * Create your own twentysixteen_sanitize_color_scheme() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @param string $value Color scheme name value. + * @return string Color scheme name. + */ + function twentysixteen_sanitize_color_scheme( $value ) { + $color_schemes = twentysixteen_get_color_scheme_choices(); - if ( ! array_key_exists( $value, $color_schemes ) ) { - return 'default'; - } + if ( ! array_key_exists( $value, $color_schemes ) ) { + return 'default'; + } - return $value; -} + return $value; + } endif; // twentysixteen_sanitize_color_scheme /** @@ -445,14 +508,17 @@ add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' ); * @return string Color scheme CSS. */ function twentysixteen_get_color_scheme_css( $colors ) { - $colors = wp_parse_args( $colors, array( - 'background_color' => '', - 'page_background_color' => '', - 'link_color' => '', - 'main_text_color' => '', - 'secondary_text_color' => '', - 'border_color' => '', - ) ); + $colors = wp_parse_args( + $colors, + array( + 'background_color' => '', + 'page_background_color' => '', + 'link_color' => '', + 'main_text_color' => '', + 'secondary_text_color' => '', + 'border_color' => '', + ) + ); return <<<CSS /* Color Scheme */ @@ -869,9 +935,9 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_page_background_color_css', 11 * @see wp_add_inline_style() */ function twentysixteen_link_color_css() { - $color_scheme = twentysixteen_get_color_scheme(); - $default_color = $color_scheme[2]; - $link_color = get_theme_mod( 'link_color', $default_color ); + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[2]; + $link_color = get_theme_mod( 'link_color', $default_color ); // Don't do anything if the current color is the default. if ( $link_color === $default_color ) { @@ -1126,8 +1192,8 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 ); * @see wp_add_inline_style() */ function twentysixteen_secondary_text_color_css() { - $color_scheme = twentysixteen_get_color_scheme(); - $default_color = $color_scheme[4]; + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[4]; $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color ); // Don't do anything if the current color is the default. diff --git a/themes/twentysixteen/inc/template-tags.php b/themes/twentysixteen/inc/template-tags.php index 9b8f1f39..caeed1c5 100644 --- a/themes/twentysixteen/inc/template-tags.php +++ b/themes/twentysixteen/inc/template-tags.php @@ -10,127 +10,133 @@ */ if ( ! function_exists( 'twentysixteen_entry_meta' ) ) : -/** - * Prints HTML with meta information for the categories, tags. - * - * Create your own twentysixteen_entry_meta() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_meta() { - if ( 'post' === get_post_type() ) { - $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); - printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', - get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), - _x( 'Author', 'Used before post author name.', 'twentysixteen' ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); - } + /** + * Prints HTML with meta information for the categories, tags. + * + * Create your own twentysixteen_entry_meta() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_meta() { + if ( 'post' === get_post_type() ) { + $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); + printf( + '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', + get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), + _x( 'Author', 'Used before post author name.', 'twentysixteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } - if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { - twentysixteen_entry_date(); - } + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + twentysixteen_entry_date(); + } - $format = get_post_format(); - if ( current_theme_supports( 'post-formats', $format ) ) { - printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', - sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), - esc_url( get_post_format_link( $format ) ), - get_post_format_string( $format ) - ); - } + $format = get_post_format(); + if ( current_theme_supports( 'post-formats', $format ) ) { + printf( + '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', + sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), + esc_url( get_post_format_link( $format ) ), + get_post_format_string( $format ) + ); + } - if ( 'post' === get_post_type() ) { - twentysixteen_entry_taxonomies(); - } + if ( 'post' === get_post_type() ) { + twentysixteen_entry_taxonomies(); + } - if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - echo '<span class="comments-link">'; - comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); - echo '</span>'; + if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo '<span class="comments-link">'; + comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); + echo '</span>'; + } } -} endif; if ( ! function_exists( 'twentysixteen_entry_date' ) ) : -/** - * Prints HTML with date information for current post. - * - * Create your own twentysixteen_entry_date() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_date() { - $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; + /** + * Prints HTML with date information for current post. + * + * Create your own twentysixteen_entry_date() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_date() { + $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; - } + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; + } - $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), - get_the_date(), - esc_attr( get_the_modified_date( 'c' ) ), - get_the_modified_date() - ); - - printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', - _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), - esc_url( get_permalink() ), - $time_string - ); -} -endif; + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() + ); -if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : -/** - * Prints HTML with category and tags for current post. - * - * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_taxonomies() { - $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - if ( $categories_list && twentysixteen_categorized_blog() ) { - printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', - _x( 'Categories', 'Used before category names.', 'twentysixteen' ), - $categories_list + printf( + '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', + _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), + esc_url( get_permalink() ), + $time_string ); } +endif; - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - if ( $tags_list && ! is_wp_error( $tags_list ) ) { - printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', - _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), - $tags_list - ); +if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : + /** + * Prints HTML with category and tags for current post. + * + * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_taxonomies() { + $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $categories_list && twentysixteen_categorized_blog() ) { + printf( + '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', + _x( 'Categories', 'Used before category names.', 'twentysixteen' ), + $categories_list + ); + } + + $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $tags_list && ! is_wp_error( $tags_list ) ) { + printf( + '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', + _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), + $tags_list + ); + } } -} endif; if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : -/** - * Displays an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index views, or a div - * element when on single views. - * - * Create your own twentysixteen_post_thumbnail() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + * + * Create your own twentysixteen_post_thumbnail() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> - <div class="post-thumbnail"> - <?php the_post_thumbnail(); ?> + <div class="post-thumbnail"> + <?php the_post_thumbnail(); ?> </div><!-- .post-thumbnail --> <?php else : ?> @@ -139,8 +145,9 @@ function twentysixteen_post_thumbnail() { <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?> </a> - <?php endif; // End is_singular() -} + <?php + endif; // End is_singular() + } endif; if ( ! function_exists( 'twentysixteen_excerpt' ) ) : @@ -158,69 +165,74 @@ if ( ! function_exists( 'twentysixteen_excerpt' ) ) : function twentysixteen_excerpt( $class = 'entry-summary' ) { $class = esc_attr( $class ); - if ( has_excerpt() || is_search() ) : ?> + if ( has_excerpt() || is_search() ) : + ?> <div class="<?php echo $class; ?>"> <?php the_excerpt(); ?> </div><!-- .<?php echo $class; ?> --> - <?php endif; + <?php + endif; } endif; if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) : -/** - * Replaces "[...]" (appended to automatically generated excerpts) with ... and - * a 'Continue reading' link. - * - * Create your own twentysixteen_excerpt_more() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return string 'Continue reading' link prepended with an ellipsis. - */ -function twentysixteen_excerpt_more() { - $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', - esc_url( get_permalink( get_the_ID() ) ), - /* translators: %s: Name of current post */ - sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) - ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and + * a 'Continue reading' link. + * + * Create your own twentysixteen_excerpt_more() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string 'Continue reading' link prepended with an ellipsis. + */ + function twentysixteen_excerpt_more() { + $link = sprintf( + '<a href="%1$s" class="more-link">%2$s</a>', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); endif; if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : -/** - * Determines whether blog/site has more than one category. - * - * Create your own twentysixteen_categorized_blog() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return bool True if there is more than one category, false otherwise. - */ -function twentysixteen_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { - // Create an array of all the categories that are attached to posts. - $all_the_cool_cats = get_categories( array( - 'fields' => 'ids', - // We only need to know if there is more than one category. - 'number' => 2, - ) ); - - // Count the number of categories that are attached to the posts. - $all_the_cool_cats = count( $all_the_cool_cats ); - - set_transient( 'twentysixteen_categories', $all_the_cool_cats ); - } + /** + * Determines whether blog/site has more than one category. + * + * Create your own twentysixteen_categorized_blog() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return bool True if there is more than one category, false otherwise. + */ + function twentysixteen_categorized_blog() { + if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { + // Create an array of all the categories that are attached to posts. + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); - if ( $all_the_cool_cats > 1 || is_preview() ) { - // This blog has more than 1 category so twentysixteen_categorized_blog should return true. - return true; - } else { - // This blog has only 1 category so twentysixteen_categorized_blog should return false. - return false; + // Count the number of categories that are attached to the posts. + $all_the_cool_cats = count( $all_the_cool_cats ); + + set_transient( 'twentysixteen_categories', $all_the_cool_cats ); + } + + if ( $all_the_cool_cats > 1 || is_preview() ) { + // This blog has more than 1 category so twentysixteen_categorized_blog should return true. + return true; + } else { + // This blog has only 1 category so twentysixteen_categorized_blog should return false. + return false; + } } -} endif; /** @@ -236,19 +248,19 @@ function twentysixteen_category_transient_flusher() { delete_transient( 'twentysixteen_categories' ); } add_action( 'edit_category', 'twentysixteen_category_transient_flusher' ); -add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); +add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : -/** - * Displays the optional custom logo. - * - * Does nothing if the custom logo is not available. - * - * @since Twenty Sixteen 1.2 - */ -function twentysixteen_the_custom_logo() { - if ( function_exists( 'the_custom_logo' ) ) { - the_custom_logo(); + /** + * Displays the optional custom logo. + * + * Does nothing if the custom logo is not available. + * + * @since Twenty Sixteen 1.2 + */ + function twentysixteen_the_custom_logo() { + if ( function_exists( 'the_custom_logo' ) ) { + the_custom_logo(); + } } -} endif; diff --git a/themes/twentysixteen/index.php b/themes/twentysixteen/index.php index 3f621abe..f6ec56c1 100644 --- a/themes/twentysixteen/index.php +++ b/themes/twentysixteen/index.php @@ -7,7 +7,7 @@ * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Sixteen @@ -29,7 +29,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -38,17 +39,19 @@ get_header(); ?> */ get_template_part( 'template-parts/content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/page.php b/themes/twentysixteen/page.php index 315a3da7..a232c9fc 100644 --- a/themes/twentysixteen/page.php +++ b/themes/twentysixteen/page.php @@ -17,7 +17,8 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); // Include the page content template. get_template_part( 'template-parts/content', 'page' ); diff --git a/themes/twentysixteen/readme.txt b/themes/twentysixteen/readme.txt index e1741beb..dcc28905 100644 --- a/themes/twentysixteen/readme.txt +++ b/themes/twentysixteen/readme.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 4.4 Tested up to: WordPress 5.0 -Version: 1.7 +Version: 1.9 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog @@ -56,6 +56,16 @@ Image used in screenshot.png: A photo by Austin Schmid (https://unsplash.com/sch == Changelog == += 1.9 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.9 + += 1.8 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.8 + = 1.7 = * Released: December 19, 2018 diff --git a/themes/twentysixteen/search.php b/themes/twentysixteen/search.php index 4180b5f9..0f893636 100644 --- a/themes/twentysixteen/search.php +++ b/themes/twentysixteen/search.php @@ -20,7 +20,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /** * Run the loop for the search to output the results. @@ -29,17 +30,19 @@ get_header(); ?> */ get_template_part( 'template-parts/content', 'search' ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); - - // If no content, include the "No posts found" template. + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); + + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/sidebar.php b/themes/twentysixteen/sidebar.php index d4d893eb..45aff971 100644 --- a/themes/twentysixteen/sidebar.php +++ b/themes/twentysixteen/sidebar.php @@ -8,7 +8,7 @@ */ ?> -<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> +<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> <aside id="secondary" class="sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-1' ); ?> </aside><!-- .sidebar .widget-area --> diff --git a/themes/twentysixteen/single.php b/themes/twentysixteen/single.php index 07e0df29..34541703 100644 --- a/themes/twentysixteen/single.php +++ b/themes/twentysixteen/single.php @@ -13,7 +13,8 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); // Include the single post content template. get_template_part( 'template-parts/content', 'single' ); @@ -25,19 +26,23 @@ get_header(); ?> if ( is_singular( 'attachment' ) ) { // Parent post navigation. - the_post_navigation( array( - 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ), - ) ); + the_post_navigation( + array( + 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ), + ) + ); } elseif ( is_singular( 'post' ) ) { // Previous/next post navigation. - the_post_navigation( array( - 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - ) ); + the_post_navigation( + array( + 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + ) + ); } // End of the loop. diff --git a/themes/twentysixteen/style.css b/themes/twentysixteen/style.css index f5a854ea..90c8b4c4 100644 --- a/themes/twentysixteen/style.css +++ b/themes/twentysixteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentysixteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. -Version: 1.7 +Version: 1.9 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog diff --git a/themes/twentysixteen/template-parts/content-page.php b/themes/twentysixteen/template-parts/content-page.php index 2b57d2b5..d1ee87c6 100644 --- a/themes/twentysixteen/template-parts/content-page.php +++ b/themes/twentysixteen/template-parts/content-page.php @@ -19,14 +19,16 @@ <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); ?> </div><!-- .entry-content --> @@ -40,6 +42,6 @@ '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); - ?> + ?> </article><!-- #post-## --> diff --git a/themes/twentysixteen/template-parts/content-single.php b/themes/twentysixteen/template-parts/content-single.php index 241f5285..d1061b27 100644 --- a/themes/twentysixteen/template-parts/content-single.php +++ b/themes/twentysixteen/template-parts/content-single.php @@ -21,19 +21,21 @@ <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); if ( '' !== get_the_author_meta( 'description' ) ) { get_template_part( 'template-parts/biography' ); } - ?> + ?> </div><!-- .entry-content --> <footer class="entry-footer"> @@ -48,6 +50,6 @@ '<span class="edit-link">', '</span>' ); - ?> + ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> diff --git a/themes/twentysixteen/template-parts/content.php b/themes/twentysixteen/template-parts/content.php index 22b0ea41..cf88417f 100644 --- a/themes/twentysixteen/template-parts/content.php +++ b/themes/twentysixteen/template-parts/content.php @@ -24,20 +24,24 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), + get_the_title() + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); - ?> + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); + ?> </div><!-- .entry-content --> <footer class="entry-footer"> @@ -52,6 +56,6 @@ '<span class="edit-link">', '</span>' ); - ?> + ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> |