Commit 9f73219e authored by lucha's avatar lucha
Browse files

[auto] theme: twentyseventeen 1.7

parent 14af1a2d
...@@ -31,4 +31,5 @@ get_header(); ?> ...@@ -31,4 +31,5 @@ get_header(); ?>
</div><!-- #primary --> </div><!-- #primary -->
</div><!-- .wrap --> </div><!-- .wrap -->
<?php get_footer(); <?php
get_footer();
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Contributors: the WordPress team Contributors: the WordPress team
Requires at least: WordPress 4.7 Requires at least: WordPress 4.7
Tested up to: WordPress 5.0-trunk Tested up to: WordPress 5.0-trunk
Version: 1.6 Version: 1.7
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
...@@ -60,6 +60,11 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k ...@@ -60,6 +60,11 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k
== Changelog == == Changelog ==
= 1.7 =
* Released: August 2, 2018
https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.7
= 1.6 = = 1.6 =
* Released: May 17, 2018 * Released: May 17, 2018
......
...@@ -27,10 +27,12 @@ get_header(); ?> ...@@ -27,10 +27,12 @@ get_header(); ?>
<main id="main" class="site-main" role="main"> <main id="main" class="site-main" role="main">
<?php <?php
if ( have_posts() ) : ?> if ( have_posts() ) :
?>
<?php <?php
/* Start the Loop */ /* Start the Loop */
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
/* /*
* Include the Post-Format-specific template for the content. * Include the Post-Format-specific template for the content.
...@@ -41,21 +43,25 @@ get_header(); ?> ...@@ -41,21 +43,25 @@ get_header(); ?>
endwhile; endwhile;
the_posts_pagination( array( the_posts_pagination(
'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', array(
'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>', 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
) ); 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
)
);
else : else :
get_template_part( 'template-parts/post/content', 'none' ); get_template_part( 'template-parts/post/content', 'none' );
endif; ?> endif;
?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
</div><!-- .wrap --> </div><!-- .wrap -->
<?php get_footer(); <?php
get_footer();
...@@ -236,12 +236,12 @@ ol { ...@@ -236,12 +236,12 @@ ol {
counter-reset: item; counter-reset: item;
} }
ol li { ol > li {
display: block; display: block;
position: relative; position: relative;
} }
ol li:before { ol > li:before {
content: counter(item); content: counter(item);
counter-increment: item; counter-increment: item;
font-weight: 800; font-weight: 800;
...@@ -584,7 +584,7 @@ object { ...@@ -584,7 +584,7 @@ object {
counter-reset: item; counter-reset: item;
} }
.rtl ol li:before { .rtl ol > li:before {
left: auto; left: auto;
right: -1.5em; right: -1.5em;
} }
......
...@@ -27,7 +27,8 @@ if ( post_password_required() ) { ...@@ -27,7 +27,8 @@ if ( post_password_required() ) {
<?php <?php
// You can start editing here -- including this comment! // You can start editing here -- including this comment!
if ( have_comments() ) : ?> if ( have_comments() ) :
?>
<h2 class="comments-title"> <h2 class="comments-title">
<?php <?php
$comments_number = get_comments_number(); $comments_number = get_comments_number();
...@@ -53,24 +54,30 @@ if ( post_password_required() ) { ...@@ -53,24 +54,30 @@ if ( post_password_required() ) {
<ol class="comment-list"> <ol class="comment-list">
<?php <?php
wp_list_comments( array( wp_list_comments(
'avatar_size' => 100, array(
'style' => 'ol', 'avatar_size' => 100,
'short_ping' => true, 'style' => 'ol',
'reply_text' => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ), 'short_ping' => true,
) ); 'reply_text' => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ),
)
);
?> ?>
</ol> </ol>
<?php the_comments_pagination( array( <?php
'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous', 'twentyseventeen' ) . '</span>', the_comments_pagination(
'next_text' => '<span class="screen-reader-text">' . __( 'Next', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), array(
) ); 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous', 'twentyseventeen' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
)
);
endif; // Check for have_comments(). endif; // Check for have_comments().
// If comments are closed and there are comments, let's leave a little note, shall we? // 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' ) ) : ?> if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p> <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p>
<?php <?php
......
...@@ -21,19 +21,23 @@ ...@@ -21,19 +21,23 @@
<?php <?php
get_template_part( 'template-parts/footer/footer', 'widgets' ); get_template_part( 'template-parts/footer/footer', 'widgets' );
if ( has_nav_menu( 'social' ) ) : ?> if ( has_nav_menu( 'social' ) ) :
?>
<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>"> <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>">
<?php <?php
wp_nav_menu( array( wp_nav_menu(
'theme_location' => 'social', array(
'menu_class' => 'social-links-menu', 'theme_location' => 'social',
'depth' => 1, 'menu_class' => 'social-links-menu',
'link_before' => '<span class="screen-reader-text">', 'depth' => 1,
'link_after' => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ), 'link_before' => '<span class="screen-reader-text">',
) ); 'link_after' => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),
)
);
?> ?>
</nav><!-- .social-navigation --> </nav><!-- .social-navigation -->
<?php endif; <?php
endif;
get_template_part( 'template-parts/footer/site', 'info' ); get_template_part( 'template-parts/footer/site', 'info' );
?> ?>
......
...@@ -17,14 +17,17 @@ get_header(); ?> ...@@ -17,14 +17,17 @@ get_header(); ?>
<div id="primary" class="content-area"> <div id="primary" class="content-area">
<main id="main" class="site-main" role="main"> <main id="main" class="site-main" role="main">
<?php // Show the selected frontpage content. <?php
// Show the selected front page content.
if ( have_posts() ) : if ( have_posts() ) :
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/page/content', 'front-page' ); get_template_part( 'template-parts/page/content', 'front-page' );
endwhile; endwhile;
else : else :
get_template_part( 'template-parts/post/content', 'none' ); get_template_part( 'template-parts/post/content', 'none' );
endif; ?> endif;
?>
<?php <?php
// Get each of our panels and show the post data. // Get each of our panels and show the post data.
...@@ -46,9 +49,11 @@ get_header(); ?> ...@@ -46,9 +49,11 @@ get_header(); ?>
twentyseventeen_front_page_section( null, $i ); twentyseventeen_front_page_section( null, $i );
} }
endif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here. ?> endif; // The if ( 0 !== twentyseventeen_panel_count() ) ends here.
?>
</main><!-- #main --> </main><!-- #main -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_footer(); <?php
get_footer();
...@@ -59,43 +59,51 @@ function twentyseventeen_setup() { ...@@ -59,43 +59,51 @@ function twentyseventeen_setup() {
$GLOBALS['content_width'] = 525; $GLOBALS['content_width'] = 525;
// This theme uses wp_nav_menu() in two locations. // This theme uses wp_nav_menu() in two locations.
register_nav_menus( array( register_nav_menus(
'top' => __( 'Top Menu', 'twentyseventeen' ), array(
'social' => __( 'Social Links Menu', 'twentyseventeen' ), 'top' => __( 'Top Menu', 'twentyseventeen' ),
) ); 'social' => __( 'Social Links Menu', 'twentyseventeen' ),
)
);
/* /*
* Switch default core markup for search form, comment form, and comments * Switch default core markup for search form, comment form, and comments
* to output valid HTML5. * to output valid HTML5.
*/ */
add_theme_support( 'html5', array( add_theme_support(
'comment-form', 'html5', array(
'comment-list', 'comment-form',
'gallery', 'comment-list',
'caption', 'gallery',
) ); 'caption',
)
);
/* /*
* Enable support for Post Formats. * Enable support for Post Formats.
* *
* See: https://codex.wordpress.org/Post_Formats * See: https://codex.wordpress.org/Post_Formats
*/ */
add_theme_support( 'post-formats', array( add_theme_support(
'aside', 'post-formats', array(
'image', 'aside',
'video', 'image',
'quote', 'video',
'link', 'quote',
'gallery', 'link',
'audio', 'gallery',
) ); 'audio',
)
);
// Add theme support for Custom Logo. // Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array( add_theme_support(
'width' => 250, 'custom-logo', array(
'height' => 250, 'width' => 250,
'flex-width' => true, 'height' => 250,
) ); 'flex-width' => true,
)
);
// Add theme support for selective refresh for widgets. // Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'customize-selective-refresh-widgets' );
...@@ -103,12 +111,12 @@ function twentyseventeen_setup() { ...@@ -103,12 +111,12 @@ function twentyseventeen_setup() {
/* /*
* This theme styles the visual editor to resemble the theme style, * This theme styles the visual editor to resemble the theme style,
* specifically font, colors, and column width. * specifically font, colors, and column width.
*/ */
add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) ); add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) );
// Define and register starter content to showcase the theme on new sites. // Define and register starter content to showcase the theme on new sites.
$starter_content = array( $starter_content = array(
'widgets' => array( 'widgets' => array(
// Place three core-defined widgets in the sidebar area. // Place three core-defined widgets in the sidebar area.
'sidebar-1' => array( 'sidebar-1' => array(
'text_business_info', 'text_business_info',
...@@ -129,15 +137,15 @@ function twentyseventeen_setup() { ...@@ -129,15 +137,15 @@ function twentyseventeen_setup() {
), ),
// Specify the core-defined pages to create and add custom thumbnails to some of them. // Specify the core-defined pages to create and add custom thumbnails to some of them.
'posts' => array( 'posts' => array(
'home', 'home',
'about' => array( 'about' => array(
'thumbnail' => '{{image-sandwich}}', 'thumbnail' => '{{image-sandwich}}',
), ),
'contact' => array( 'contact' => array(
'thumbnail' => '{{image-espresso}}', 'thumbnail' => '{{image-espresso}}',
), ),
'blog' => array( 'blog' => array(
'thumbnail' => '{{image-coffee}}', 'thumbnail' => '{{image-coffee}}',
), ),
'homepage-section' => array( 'homepage-section' => array(
...@@ -149,27 +157,27 @@ function twentyseventeen_setup() { ...@@ -149,27 +157,27 @@ function twentyseventeen_setup() {
'attachments' => array( 'attachments' => array(
'image-espresso' => array( 'image-espresso' => array(
'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ), 'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),
'file' => 'assets/images/espresso.jpg', // URL relative to the template directory. 'file' => 'assets/images/espresso.jpg', // URL relative to the template directory.
), ),
'image-sandwich' => array( 'image-sandwich' => array(
'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ), 'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ),
'file' => 'assets/images/sandwich.jpg', 'file' => 'assets/images/sandwich.jpg',
), ),
'image-coffee' => array( 'image-coffee' => array(
'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ), 'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ),
'file' => 'assets/images/coffee.jpg', 'file' => 'assets/images/coffee.jpg',
), ),
), ),
// Default to a static front page and assign the front and posts pages. // Default to a static front page and assign the front and posts pages.
'options' => array( 'options' => array(
'show_on_front' => 'page', 'show_on_front' => 'page',
'page_on_front' => '{{home}}', 'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}', 'page_for_posts' => '{{blog}}',
), ),
// Set the front page section theme mods to the IDs of the core-registered pages. // Set the front page section theme mods to the IDs of the core-registered pages.
'theme_mods' => array( 'theme_mods' => array(
'panel_1' => '{{homepage-section}}', 'panel_1' => '{{homepage-section}}',
'panel_2' => '{{about}}', 'panel_2' => '{{about}}',
'panel_3' => '{{blog}}', 'panel_3' => '{{blog}}',
...@@ -177,10 +185,10 @@ function twentyseventeen_setup() { ...@@ -177,10 +185,10 @@ function twentyseventeen_setup() {
), ),
// Set up nav menus for each of the two areas registered in the theme. // Set up nav menus for each of the two areas registered in the theme.
'nav_menus' => array( 'nav_menus' => array(
// Assign a menu to the "top" location. // Assign a menu to the "top" location.
'top' => array( 'top' => array(
'name' => __( 'Top Menu', 'twentyseventeen' ), 'name' => __( 'Top Menu', 'twentyseventeen' ),
'items' => array( 'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used. 'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about', 'page_about',
...@@ -191,7 +199,7 @@ function twentyseventeen_setup() { ...@@ -191,7 +199,7 @@ function twentyseventeen_setup() {
// Assign a menu to the "social" location. // Assign a menu to the "social" location.
'social' => array( 'social' => array(
'name' => __( 'Social Links Menu', 'twentyseventeen' ), 'name' => __( 'Social Links Menu', 'twentyseventeen' ),
'items' => array( 'items' => array(
'link_yelp', 'link_yelp',
'link_facebook', 'link_facebook',
...@@ -311,35 +319,41 @@ add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 ); ...@@ -311,35 +319,41 @@ add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 );
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/ */
function twentyseventeen_widgets_init() { function twentyseventeen_widgets_init() {
register_sidebar( array( register_sidebar(
'name' => __( 'Blog Sidebar', 'twentyseventeen' ), array(
'id' => 'sidebar-1', 'name' => __( 'Blog Sidebar', 'twentyseventeen' ),
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ), 'id' => 'sidebar-1',
'before_widget' => '<section id="%1$s" class="widget %2$s">', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ),
'after_widget' => '</section>', 'before_widget' => '<section id="%1$s" class="widget %2$s">',
'before_title' => '<h2 class="widget-title">', 'after_widget' => '</section>',
'after_title' => '</h2>', 'before_title' => '<h2 class="widget-title">',
) ); 'after_title' => '</h2>',
)
register_sidebar( array( );
'name' => __( 'Footer 1', 'twentyseventeen' ),
'id' => 'sidebar-2', register_sidebar(
'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ), array(
'before_widget' => '<section id="%1$s" class="widget %2$s">', 'name' => __( 'Footer 1', 'twentyseventeen' ),
'after_widget' => '</section>', 'id' => 'sidebar-2',
'before_title' => '<h2 class="widget-title">', 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ),
'after_title' => '</h2>', 'before_widget' => '<section id="%1$s" class="widget %2$s">',
) ); 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
register_sidebar( array( 'after_title' => '</h2>',
'name' => __( 'Footer 2', 'twentyseventeen' ), )
'id' => 'sidebar-3', );
'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">', register_sidebar(
'after_widget' => '</section>', array(
'before_title' => '<h2 class="widget-title">', 'name' => __( 'Footer 2', 'twentyseventeen' ),
'after_title' => '</h2>', 'id' => 'sidebar-3',
) ); 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ),
'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', 'twentyseventeen_widgets_init' ); add_action( 'widgets_init', 'twentyseventeen_widgets_init' );
...@@ -357,7 +371,8 @@ function twentyseventeen_excerpt_more( $link ) { ...@@ -357,7 +371,8 @@ function twentyseventeen_excerpt_more( $link ) {
return $link; return $link;
} }
$link = sprintf( '<p class="link-more"><a href="%1$s" class="more-link">%2$s</a></p>', $link = sprintf(
'<p class="link-more"><a href="%1$s" class="more-link">%2$s</a></p>',
esc_url( get_permalink( get_the_ID() ) ), esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */ /* translators: %s: Name of current post */
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), get_the_title( get_the_ID() ) ) sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), get_the_title( get_the_ID() ) )
...@@ -398,11 +413,17 @@ function twentyseventeen_colors_css_wrap() { ...@@ -398,11 +413,17 @@ function twentyseventeen_colors_css_wrap() {
require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) );
$hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); $hue = absint( get_theme_mod( 'colorscheme_hue', 250