diff --git a/wp-content/themes/twentyseventeen/404.php b/wp-content/themes/twentyseventeen/404.php index 4a6d11353b0f1106bcf2bac138a4cce3590f672c..3eb2a30bb75d166ff8ddf473935ba30f4b208363 100644 --- a/wp-content/themes/twentyseventeen/404.php +++ b/wp-content/themes/twentyseventeen/404.php @@ -31,4 +31,5 @@ get_header(); ?> </div><!-- #primary --> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/README.txt b/wp-content/themes/twentyseventeen/README.txt index a11d2b507765de41505548958db40f09c9e2e8d4..884df3761435810344c3e4fe0856eeef90b6f103 100644 --- a/wp-content/themes/twentyseventeen/README.txt +++ b/wp-content/themes/twentyseventeen/README.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 4.7 Tested up to: WordPress 5.0-trunk -Version: 1.6 +Version: 1.7 License: GPLv2 or later 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 @@ -60,6 +60,11 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k == Changelog == += 1.7 = +* Released: August 2, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.7 + = 1.6 = * Released: May 17, 2018 diff --git a/wp-content/themes/twentyseventeen/archive.php b/wp-content/themes/twentyseventeen/archive.php index 6f9e03c37e335455353e231eeefe194442e5c061..5a024347ac25a17a985e97e575d315ef80982433 100644 --- a/wp-content/themes/twentyseventeen/archive.php +++ b/wp-content/themes/twentyseventeen/archive.php @@ -27,10 +27,12 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php - if ( have_posts() ) : ?> + if ( have_posts() ) : + ?> <?php /* Start the Loop */ - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -41,21 +43,25 @@ get_header(); ?> endwhile; - the_posts_pagination( array( - 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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>', - ) ); + the_posts_pagination( + array( + 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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 : get_template_part( 'template-parts/post/content', 'none' ); - endif; ?> + endif; + ?> </main><!-- #main --> </div><!-- #primary --> <?php get_sidebar(); ?> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/assets/css/editor-style.css b/wp-content/themes/twentyseventeen/assets/css/editor-style.css index 5c1137347e6bc8ae8bdcf6ff6d5e17b19f40edfb..dd929f867b02d22006b35c0de5c203bcde2ef177 100644 --- a/wp-content/themes/twentyseventeen/assets/css/editor-style.css +++ b/wp-content/themes/twentyseventeen/assets/css/editor-style.css @@ -236,12 +236,12 @@ ol { counter-reset: item; } -ol li { +ol > li { display: block; position: relative; } -ol li:before { +ol > li:before { content: counter(item); counter-increment: item; font-weight: 800; @@ -584,7 +584,7 @@ object { counter-reset: item; } -.rtl ol li:before { +.rtl ol > li:before { left: auto; right: -1.5em; } diff --git a/wp-content/themes/twentyseventeen/comments.php b/wp-content/themes/twentyseventeen/comments.php index f93c09eaf15671b986466df9857da0914083a372..a8c8f287ae4ef2ae62e953091de5d03fe7967d64 100644 --- a/wp-content/themes/twentyseventeen/comments.php +++ b/wp-content/themes/twentyseventeen/comments.php @@ -27,7 +27,8 @@ if ( post_password_required() ) { <?php // You can start editing here -- including this comment! - if ( have_comments() ) : ?> + if ( have_comments() ) : + ?> <h2 class="comments-title"> <?php $comments_number = get_comments_number(); @@ -53,24 +54,30 @@ if ( post_password_required() ) { <ol class="comment-list"> <?php - wp_list_comments( array( - 'avatar_size' => 100, - 'style' => 'ol', - 'short_ping' => true, - 'reply_text' => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ), - ) ); + wp_list_comments( + array( + 'avatar_size' => 100, + 'style' => 'ol', + 'short_ping' => true, + 'reply_text' => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ), + ) + ); ?> </ol> - <?php the_comments_pagination( 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' ) ), - ) ); + <?php + the_comments_pagination( + 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(). // 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> <?php diff --git a/wp-content/themes/twentyseventeen/footer.php b/wp-content/themes/twentyseventeen/footer.php index 504f573f878d8497d5a2fd1b1d73b4323cfc376b..8d8086fff5dcfe37befe88252c5f4c5fc7e58a98 100644 --- a/wp-content/themes/twentyseventeen/footer.php +++ b/wp-content/themes/twentyseventeen/footer.php @@ -21,19 +21,23 @@ <?php 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' ); ?>"> <?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>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ), - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'menu_class' => 'social-links-menu', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ), + ) + ); ?> </nav><!-- .social-navigation --> - <?php endif; + <?php + endif; get_template_part( 'template-parts/footer/site', 'info' ); ?> diff --git a/wp-content/themes/twentyseventeen/front-page.php b/wp-content/themes/twentyseventeen/front-page.php index bb593f6acf77f54ad30354dac8e74b892c485a77..460c942ac92dc3a56c7213c6e9b860dd7c957fa3 100644 --- a/wp-content/themes/twentyseventeen/front-page.php +++ b/wp-content/themes/twentyseventeen/front-page.php @@ -17,14 +17,17 @@ get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> - <?php // Show the selected frontpage content. + <?php + // Show the selected front page content. if ( have_posts() ) : - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); get_template_part( 'template-parts/page/content', 'front-page' ); endwhile; else : get_template_part( 'template-parts/post/content', 'none' ); - endif; ?> + endif; + ?> <?php // Get each of our panels and show the post data. @@ -46,9 +49,11 @@ get_header(); ?> 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 --> </div><!-- #primary --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/functions.php b/wp-content/themes/twentyseventeen/functions.php index 14e1a625daf1d1ea4a2e013a9134ee618f8f023d..2e147a92da567f8a5c784dbe14f9104da3fd1dbe 100644 --- a/wp-content/themes/twentyseventeen/functions.php +++ b/wp-content/themes/twentyseventeen/functions.php @@ -59,43 +59,51 @@ function twentyseventeen_setup() { $GLOBALS['content_width'] = 525; // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'top' => __( 'Top Menu', 'twentyseventeen' ), - 'social' => __( 'Social Links Menu', 'twentyseventeen' ), - ) ); + register_nav_menus( + array( + 'top' => __( 'Top Menu', 'twentyseventeen' ), + 'social' => __( 'Social Links Menu', 'twentyseventeen' ), + ) + ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ - add_theme_support( 'html5', array( - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) ); + add_theme_support( + 'html5', array( + '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', - 'audio', - ) ); + add_theme_support( + 'post-formats', array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'audio', + ) + ); // Add theme support for Custom Logo. - add_theme_support( 'custom-logo', array( - 'width' => 250, - 'height' => 250, - 'flex-width' => true, - ) ); + add_theme_support( + 'custom-logo', array( + 'width' => 250, + 'height' => 250, + 'flex-width' => true, + ) + ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); @@ -103,12 +111,12 @@ function twentyseventeen_setup() { /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, and column width. - */ + */ add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) ); // Define and register starter content to showcase the theme on new sites. $starter_content = array( - 'widgets' => array( + 'widgets' => array( // Place three core-defined widgets in the sidebar area. 'sidebar-1' => array( 'text_business_info', @@ -129,15 +137,15 @@ function twentyseventeen_setup() { ), // Specify the core-defined pages to create and add custom thumbnails to some of them. - 'posts' => array( + 'posts' => array( 'home', - 'about' => array( + 'about' => array( 'thumbnail' => '{{image-sandwich}}', ), - 'contact' => array( + 'contact' => array( 'thumbnail' => '{{image-espresso}}', ), - 'blog' => array( + 'blog' => array( 'thumbnail' => '{{image-coffee}}', ), 'homepage-section' => array( @@ -149,27 +157,27 @@ function twentyseventeen_setup() { 'attachments' => array( 'image-espresso' => array( '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( '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' ), - 'file' => 'assets/images/coffee.jpg', + 'file' => 'assets/images/coffee.jpg', ), ), // Default to a static front page and assign the front and posts pages. - 'options' => array( - 'show_on_front' => 'page', - 'page_on_front' => '{{home}}', + 'options' => array( + 'show_on_front' => 'page', + 'page_on_front' => '{{home}}', 'page_for_posts' => '{{blog}}', ), // 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_2' => '{{about}}', 'panel_3' => '{{blog}}', @@ -177,10 +185,10 @@ function twentyseventeen_setup() { ), // 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. - 'top' => array( - 'name' => __( 'Top Menu', 'twentyseventeen' ), + 'top' => array( + 'name' => __( 'Top Menu', 'twentyseventeen' ), 'items' => array( 'link_home', // Note that the core "home" page is actually a link in case a static front page is not used. 'page_about', @@ -191,7 +199,7 @@ function twentyseventeen_setup() { // Assign a menu to the "social" location. 'social' => array( - 'name' => __( 'Social Links Menu', 'twentyseventeen' ), + 'name' => __( 'Social Links Menu', 'twentyseventeen' ), 'items' => array( 'link_yelp', 'link_facebook', @@ -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 */ function twentyseventeen_widgets_init() { - register_sidebar( array( - 'name' => __( 'Blog Sidebar', 'twentyseventeen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ), - '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' => __( 'Footer 1', 'twentyseventeen' ), - 'id' => 'sidebar-2', - '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>', - ) ); - - register_sidebar( array( - '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">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); + register_sidebar( + array( + 'name' => __( 'Blog Sidebar', 'twentyseventeen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ), + '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' => __( 'Footer 1', 'twentyseventeen' ), + 'id' => 'sidebar-2', + '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>', + ) + ); + + register_sidebar( + array( + '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">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); } add_action( 'widgets_init', 'twentyseventeen_widgets_init' ); @@ -357,7 +371,8 @@ function twentyseventeen_excerpt_more( $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() ) ), /* translators: %s: Name of current post */ 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() { require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); + + $customize_preview_data_hue = ''; + if ( is_customize_preview() ) { + $customize_preview_data_hue = 'data-hue="' . $hue . '"'; + } ?> - <style type="text/css" id="custom-theme-colors" <?php if ( is_customize_preview() ) { echo 'data-hue="' . $hue . '"'; } ?>> + <style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>> <?php echo twentyseventeen_custom_colors_css(); ?> </style> -<?php } +<?php +} add_action( 'wp_head', 'twentyseventeen_colors_css_wrap' ); /** @@ -437,14 +458,19 @@ function twentyseventeen_scripts() { wp_enqueue_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '1.0', true ); $twentyseventeen_l10n = array( - 'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), + 'quote' => twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), ); if ( has_nav_menu( 'top' ) ) { wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '1.0', true ); - $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); - $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); - $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( array( 'icon' => 'angle-down', 'fallback' => true ) ); + $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( + array( + 'icon' => 'angle-down', + 'fallback' => true, + ) + ); } wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '1.0', true ); @@ -479,7 +505,7 @@ function twentyseventeen_content_image_sizes_attr( $sizes, $size ) { if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) { if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) { - $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; + $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; } } @@ -539,7 +565,7 @@ add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnai function twentyseventeen_front_page_template( $template ) { return is_home() ? '' : $template; } -add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' ); +add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' ); /** * Modifies tag cloud widget arguments to display all tags in the same font size diff --git a/wp-content/themes/twentyseventeen/inc/back-compat.php b/wp-content/themes/twentyseventeen/inc/back-compat.php index 4772f5621aea940c6cb40884901fec5c9660d4e7..fad87f91ba0dc6933c186b3beed2e1e03cd5d944 100644 --- a/wp-content/themes/twentyseventeen/inc/back-compat.php +++ b/wp-content/themes/twentyseventeen/inc/back-compat.php @@ -48,9 +48,11 @@ function twentyseventeen_upgrade_notice() { * @global string $wp_version WordPress version. */ function twentyseventeen_customize() { - wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), '', array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentyseventeen_customize' ); diff --git a/wp-content/themes/twentyseventeen/inc/color-patterns.php b/wp-content/themes/twentyseventeen/inc/color-patterns.php index 3f1ecddd0c2e99a347b8786c5389b7a3a232affc..ddd25d089eea0a4febf6cd8e796bc271af4d6543 100644 --- a/wp-content/themes/twentyseventeen/inc/color-patterns.php +++ b/wp-content/themes/twentyseventeen/inc/color-patterns.php @@ -20,10 +20,10 @@ function twentyseventeen_custom_colors_css() { * * @param int $saturation Color saturation level. */ - $saturation = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) ); + $saturation = absint( apply_filters( 'twentyseventeen_custom_colors_saturation', 50 ) ); $reduced_saturation = ( .8 * $saturation ) . '%'; - $saturation = $saturation . '%'; - $css = ' + $saturation = $saturation . '%'; + $css = ' /** * Twenty Seventeen: Color Patterns * diff --git a/wp-content/themes/twentyseventeen/inc/custom-header.php b/wp-content/themes/twentyseventeen/inc/custom-header.php index 6e19a7f98b7054b1f53f42368c531fef49881645..1cc6114a98f2092aaa12c191a4105d47ac0a4c7b 100644 --- a/wp-content/themes/twentyseventeen/inc/custom-header.php +++ b/wp-content/themes/twentyseventeen/inc/custom-header.php @@ -24,53 +24,59 @@ function twentyseventeen_custom_header_setup() { * @param array $args { * An array of custom-header support arguments. * - * @type string $default-image Default image of the header. + * @type string $default-image Default image of the header. * @type string $default_text_color Default color of the header text. * @type int $width Width in pixels of the custom header image. Default 954. * @type int $height Height in pixels of the custom header image. Default 1300. * @type string $wp-head-callback Callback function used to styles the header image and text * displayed on the blog. - * @type string $flex-height Flex support for height of header. + * @type string $flex-height Flex support for height of header. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentyseventeen_custom_header_args', array( - 'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ), - 'width' => 2000, - 'height' => 1200, - 'flex-height' => true, - 'video' => true, - 'wp-head-callback' => 'twentyseventeen_header_style', - ) ) ); + add_theme_support( + 'custom-header', apply_filters( + 'twentyseventeen_custom_header_args', array( + 'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ), + 'width' => 2000, + 'height' => 1200, + 'flex-height' => true, + 'video' => true, + 'wp-head-callback' => 'twentyseventeen_header_style', + ) + ) + ); - register_default_headers( array( - 'default-image' => array( - 'url' => '%s/assets/images/header.jpg', - 'thumbnail_url' => '%s/assets/images/header.jpg', - 'description' => __( 'Default Header Image', 'twentyseventeen' ), - ), - ) ); + register_default_headers( + array( + 'default-image' => array( + 'url' => '%s/assets/images/header.jpg', + 'thumbnail_url' => '%s/assets/images/header.jpg', + 'description' => __( 'Default Header Image', 'twentyseventeen' ), + ), + ) + ); } add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); if ( ! function_exists( 'twentyseventeen_header_style' ) ) : -/** - * Styles the header image and text displayed on the blog. - * - * @see twentyseventeen_custom_header_setup(). - */ -function twentyseventeen_header_style() { - $header_text_color = get_header_textcolor(); + /** + * Styles the header image and text displayed on the blog. + * + * @see twentyseventeen_custom_header_setup(). + */ + function twentyseventeen_header_style() { + $header_text_color = get_header_textcolor(); - // If no custom options for text are set, let's bail. - // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. - if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { - return; - } + // If no custom options for text are set, let's bail. + // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. + if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { + return; + } - // If we get this far, we have custom styles. Let's do this. - ?> - <style id="twentyseventeen-custom-header-styles" type="text/css"> - <?php + // If we get this far, we have custom styles. Let's do this. + ?> + <style id="twentyseventeen-custom-header-styles" type="text/css"> + <?php // Has the text been hidden? if ( 'blank' === $header_text_color ) : ?> @@ -106,7 +112,7 @@ function twentyseventeen_header_style() { <?php endif; ?> </style> <?php -} + } endif; // End of twentyseventeen_header_style. /** @@ -116,7 +122,7 @@ endif; // End of twentyseventeen_header_style. * @return array The filtered video settings. */ function twentyseventeen_video_controls( $settings ) { - $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); + $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) ); return $settings; } diff --git a/wp-content/themes/twentyseventeen/inc/customizer.php b/wp-content/themes/twentyseventeen/inc/customizer.php index bc6bbea31cdbfe64d531b1f8d6d06ddc3b779523..abc27fb057e04f13a187c1104fa225327c217f65 100644 --- a/wp-content/themes/twentyseventeen/inc/customizer.php +++ b/wp-content/themes/twentyseventeen/inc/customizer.php @@ -13,77 +13,97 @@ * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function twentyseventeen_customize_register( $wp_customize ) { - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; - - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'render_callback' => 'twentyseventeen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', - ) ); + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + $wp_customize->selective_refresh->add_partial( + 'blogname', array( + 'selector' => '.site-title a', + 'render_callback' => 'twentyseventeen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', array( + 'selector' => '.site-description', + 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', + ) + ); /** * Custom colors. */ - $wp_customize->add_setting( 'colorscheme', array( - 'default' => 'light', - 'transport' => 'postMessage', - 'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme', - ) ); - - $wp_customize->add_setting( 'colorscheme_hue', array( - 'default' => 250, - 'transport' => 'postMessage', - 'sanitize_callback' => 'absint', // The hue is stored as a positive integer. - ) ); - - $wp_customize->add_control( 'colorscheme', array( - 'type' => 'radio', - 'label' => __( 'Color Scheme', 'twentyseventeen' ), - 'choices' => array( - 'light' => __( 'Light', 'twentyseventeen' ), - 'dark' => __( 'Dark', 'twentyseventeen' ), - 'custom' => __( 'Custom', 'twentyseventeen' ), - ), - 'section' => 'colors', - 'priority' => 5, - ) ); - - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'colorscheme_hue', array( - 'mode' => 'hue', - 'section' => 'colors', - 'priority' => 6, - ) ) ); + $wp_customize->add_setting( + 'colorscheme', array( + 'default' => 'light', + 'transport' => 'postMessage', + 'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme', + ) + ); + + $wp_customize->add_setting( + 'colorscheme_hue', array( + 'default' => 250, + 'transport' => 'postMessage', + 'sanitize_callback' => 'absint', // The hue is stored as a positive integer. + ) + ); + + $wp_customize->add_control( + 'colorscheme', array( + 'type' => 'radio', + 'label' => __( 'Color Scheme', 'twentyseventeen' ), + 'choices' => array( + 'light' => __( 'Light', 'twentyseventeen' ), + 'dark' => __( 'Dark', 'twentyseventeen' ), + 'custom' => __( 'Custom', 'twentyseventeen' ), + ), + 'section' => 'colors', + 'priority' => 5, + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, 'colorscheme_hue', array( + 'mode' => 'hue', + 'section' => 'colors', + 'priority' => 6, + ) + ) + ); /** * Theme options. */ - $wp_customize->add_section( 'theme_options', array( - 'title' => __( 'Theme Options', 'twentyseventeen' ), - 'priority' => 130, // Before Additional CSS. - ) ); - - $wp_customize->add_setting( 'page_layout', array( - 'default' => 'two-column', - 'sanitize_callback' => 'twentyseventeen_sanitize_page_layout', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( 'page_layout', array( - 'label' => __( 'Page Layout', 'twentyseventeen' ), - 'section' => 'theme_options', - 'type' => 'radio', - 'description' => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ), - 'choices' => array( - 'one-column' => __( 'One Column', 'twentyseventeen' ), - 'two-column' => __( 'Two Column', 'twentyseventeen' ), - ), - 'active_callback' => 'twentyseventeen_is_view_with_layout_option', - ) ); + $wp_customize->add_section( + 'theme_options', array( + 'title' => __( 'Theme Options', 'twentyseventeen' ), + 'priority' => 130, // Before Additional CSS. + ) + ); + + $wp_customize->add_setting( + 'page_layout', array( + 'default' => 'two-column', + 'sanitize_callback' => 'twentyseventeen_sanitize_page_layout', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'page_layout', array( + 'label' => __( 'Page Layout', 'twentyseventeen' ), + 'section' => 'theme_options', + 'type' => 'radio', + 'description' => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ), + 'choices' => array( + 'one-column' => __( 'One Column', 'twentyseventeen' ), + 'two-column' => __( 'Two Column', 'twentyseventeen' ), + ), + 'active_callback' => 'twentyseventeen_is_view_with_layout_option', + ) + ); /** * Filter number of front page sections in Twenty Seventeen. @@ -96,27 +116,33 @@ function twentyseventeen_customize_register( $wp_customize ) { // Create a setting and control for each of the sections available in the theme. for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { - $wp_customize->add_setting( 'panel_' . $i, array( - 'default' => false, - 'sanitize_callback' => 'absint', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( 'panel_' . $i, array( - /* translators: %d is the front page section number */ - 'label' => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ), - 'description' => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ), - 'section' => 'theme_options', - 'type' => 'dropdown-pages', - 'allow_addition' => true, - 'active_callback' => 'twentyseventeen_is_static_front_page', - ) ); - - $wp_customize->selective_refresh->add_partial( 'panel_' . $i, array( - 'selector' => '#panel' . $i, - 'render_callback' => 'twentyseventeen_front_page_section', - 'container_inclusive' => true, - ) ); + $wp_customize->add_setting( + 'panel_' . $i, array( + 'default' => false, + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'panel_' . $i, array( + /* translators: %d is the front page section number */ + 'label' => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ), + 'description' => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ), + 'section' => 'theme_options', + 'type' => 'dropdown-pages', + 'allow_addition' => true, + 'active_callback' => 'twentyseventeen_is_static_front_page', + ) + ); + + $wp_customize->selective_refresh->add_partial( + 'panel_' . $i, array( + 'selector' => '#panel' . $i, + 'render_callback' => 'twentyseventeen_front_page_section', + 'container_inclusive' => true, + ) + ); } } add_action( 'customize_register', 'twentyseventeen_customize_register' ); diff --git a/wp-content/themes/twentyseventeen/inc/icon-functions.php b/wp-content/themes/twentyseventeen/inc/icon-functions.php index 3425f740df60e2bec763135a2549d6838611f20f..87572bcecd0a0a1e9c3e8bd6357677d47d6a6c00 100644 --- a/wp-content/themes/twentyseventeen/inc/icon-functions.php +++ b/wp-content/themes/twentyseventeen/inc/icon-functions.php @@ -46,10 +46,10 @@ function twentyseventeen_get_svg( $args = array() ) { // Set defaults. $defaults = array( - 'icon' => '', - 'title' => '', - 'desc' => '', - 'fallback' => false, + 'icon' => '', + 'title' => '', + 'desc' => '', + 'fallback' => false, ); // Parse args. diff --git a/wp-content/themes/twentyseventeen/inc/template-functions.php b/wp-content/themes/twentyseventeen/inc/template-functions.php index 9ecbe56a84020c1301223c83922696a42edcfb0e..b9e0d882822c5ab01f96c6396fa725ca41101589 100644 --- a/wp-content/themes/twentyseventeen/inc/template-functions.php +++ b/wp-content/themes/twentyseventeen/inc/template-functions.php @@ -59,7 +59,7 @@ function twentyseventeen_body_classes( $classes ) { } // Get the colorscheme or the default if there isn't one. - $colors = twentyseventeen_sanitize_colorscheme( get_theme_mod( 'colorscheme', 'light' ) ); + $colors = twentyseventeen_sanitize_colorscheme( get_theme_mod( 'colorscheme', 'light' ) ); $classes[] = 'colors-' . $colors; return $classes; @@ -95,7 +95,7 @@ function twentyseventeen_panel_count() { } /** - * Checks to see if we're on the homepage or not. + * Checks to see if we're on the front page or not. */ function twentyseventeen_is_frontpage() { return ( is_front_page() && ! is_home() ); diff --git a/wp-content/themes/twentyseventeen/inc/template-tags.php b/wp-content/themes/twentyseventeen/inc/template-tags.php index a99230d9636a5e0bfb26af478ec601cb5d903792..8fec665a283e29079b2a4c42ef8100cf2951e5ba 100644 --- a/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -10,83 +10,84 @@ */ if ( ! function_exists( 'twentyseventeen_posted_on' ) ) : -/** - * Prints HTML with meta information for the current post-date/time and author. - */ -function twentyseventeen_posted_on() { - - // Get the author name; wrap it in a link. - $byline = sprintf( - /* translators: %s: post author */ - __( 'by %s', 'twentyseventeen' ), - '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' - ); - - // Finally, let's write all of this to the page. - echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>'; -} + /** + * Prints HTML with meta information for the current post-date/time and author. + */ + function twentyseventeen_posted_on() { + + // Get the author name; wrap it in a link. + $byline = sprintf( + /* translators: %s: post author */ + __( 'by %s', 'twentyseventeen' ), + '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' + ); + + // Finally, let's write all of this to the page. + echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>'; + } endif; if ( ! function_exists( 'twentyseventeen_time_link' ) ) : -/** - * Gets a nicely formatted string for the published date. - */ -function twentyseventeen_time_link() { - $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>'; + /** + * Gets a nicely formatted string for the published date. + */ + function twentyseventeen_time_link() { + $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>'; + } + + $time_string = sprintf( + $time_string, + get_the_date( DATE_W3C ), + get_the_date(), + get_the_modified_date( DATE_W3C ), + get_the_modified_date() + ); + + // Wrap the time string in a link, and preface it with 'Posted on'. + return sprintf( + /* translators: %s: post date */ + __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ), + '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' + ); } - - $time_string = sprintf( $time_string, - get_the_date( DATE_W3C ), - get_the_date(), - get_the_modified_date( DATE_W3C ), - get_the_modified_date() - ); - - // Wrap the time string in a link, and preface it with 'Posted on'. - return sprintf( - /* translators: %s: post date */ - __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ), - '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' - ); -} endif; if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : -/** - * Prints HTML with meta information for the categories, tags and comments. - */ -function twentyseventeen_entry_footer() { + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function twentyseventeen_entry_footer() { - /* translators: used between list items, there is a space after the comma */ - $separate_meta = __( ', ', 'twentyseventeen' ); + /* translators: used between list items, there is a space after the comma */ + $separate_meta = __( ', ', 'twentyseventeen' ); - // Get Categories for posts. - $categories_list = get_the_category_list( $separate_meta ); + // Get Categories for posts. + $categories_list = get_the_category_list( $separate_meta ); - // Get Tags for posts. - $tags_list = get_the_tag_list( '', $separate_meta ); + // Get Tags for posts. + $tags_list = get_the_tag_list( '', $separate_meta ); - // We don't want to output .entry-footer if it will be empty, so make sure its not. - if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { + // We don't want to output .entry-footer if it will be empty, so make sure its not. + if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { - echo '<footer class="entry-footer">'; + echo '<footer class="entry-footer">'; if ( 'post' === get_post_type() ) { if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) { echo '<span class="cat-tags-links">'; // Make sure there's more than one category before displaying. - if ( $categories_list && twentyseventeen_categorized_blog() ) { - echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; - } + if ( $categories_list && twentyseventeen_categorized_blog() ) { + echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; + } - if ( $tags_list && ! is_wp_error( $tags_list ) ) { - echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; - } + if ( $tags_list && ! is_wp_error( $tags_list ) ) { + echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; + } echo '</span>'; } @@ -94,32 +95,32 @@ function twentyseventeen_entry_footer() { twentyseventeen_edit_link(); - echo '</footer> <!-- .entry-footer -->'; + echo '</footer> <!-- .entry-footer -->'; + } } -} endif; if ( ! function_exists( 'twentyseventeen_edit_link' ) ) : -/** - * Returns an accessibility-friendly link to edit a post or page. - * - * This also gives us a little context about what exactly we're editing - * (post or page?) so that users understand a bit more where they are in terms - * of the template hierarchy and their content. Helpful when/if the single-page - * layout with multiple posts/pages shown gets confusing. - */ -function twentyseventeen_edit_link() { - edit_post_link( - sprintf( - /* translators: %s: Name of current post */ - __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ), - '<span class="edit-link">', - '</span>' - ); -} + /** + * Returns an accessibility-friendly link to edit a post or page. + * + * This also gives us a little context about what exactly we're editing + * (post or page?) so that users understand a bit more where they are in terms + * of the template hierarchy and their content. Helpful when/if the single-page + * layout with multiple posts/pages shown gets confusing. + */ + function twentyseventeen_edit_link() { + edit_post_link( + sprintf( + /* translators: %s: Name of current post */ + __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ), + '<span class="edit-link">', + '</span>' + ); + } endif; /** @@ -132,7 +133,7 @@ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { if ( is_a( $partial, 'WP_Customize_Partial' ) ) { // Find out the id and set it up during a selective refresh. global $twentyseventeencounter; - $id = str_replace( 'panel_', '', $partial->id ); + $id = str_replace( 'panel_', '', $partial->id ); $twentyseventeencounter = $id; } @@ -161,12 +162,14 @@ function twentyseventeen_categorized_blog() { if ( false === $category_count ) { // Create an array of all the categories that are attached to posts. - $categories = get_categories( array( - 'fields' => 'ids', - 'hide_empty' => 1, - // We only need to know if there is more than one category. - 'number' => 2, - ) ); + $categories = get_categories( + array( + 'fields' => 'ids', + 'hide_empty' => 1, + // 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. $category_count = count( $categories ); @@ -194,4 +197,4 @@ function twentyseventeen_category_transient_flusher() { delete_transient( 'twentyseventeen_categories' ); } add_action( 'edit_category', 'twentyseventeen_category_transient_flusher' ); -add_action( 'save_post', 'twentyseventeen_category_transient_flusher' ); +add_action( 'save_post', 'twentyseventeen_category_transient_flusher' ); diff --git a/wp-content/themes/twentyseventeen/index.php b/wp-content/themes/twentyseventeen/index.php index 78d1b4c93eceee15332c1cdce1fe22dccb9e1795..3eab9ff6561274246cc9246c6c6f43444953b20d 100644 --- a/wp-content/themes/twentyseventeen/index.php +++ b/wp-content/themes/twentyseventeen/index.php @@ -35,7 +35,8 @@ get_header(); ?> if ( have_posts() ) : /* Start the Loop */ - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -46,11 +47,13 @@ get_header(); ?> endwhile; - the_posts_pagination( array( - 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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>', - ) ); + the_posts_pagination( + array( + 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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 : @@ -64,4 +67,5 @@ get_header(); ?> <?php get_sidebar(); ?> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/page.php b/wp-content/themes/twentyseventeen/page.php index 96211f49dc1abee30776aeb6df021775b820c507..5d42e2ce48fdaf3e5e62cf0dfc40e0b1624a4066 100644 --- a/wp-content/themes/twentyseventeen/page.php +++ b/wp-content/themes/twentyseventeen/page.php @@ -22,7 +22,8 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); get_template_part( 'template-parts/page/content', 'page' ); @@ -38,4 +39,5 @@ get_header(); ?> </div><!-- #primary --> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/search.php b/wp-content/themes/twentyseventeen/search.php index c6967f2031e235b619262ff89b2526d0682c4b4a..c2a6527467dd330658c55442e976731eff393b65 100644 --- a/wp-content/themes/twentyseventeen/search.php +++ b/wp-content/themes/twentyseventeen/search.php @@ -28,7 +28,8 @@ get_header(); ?> <?php if ( have_posts() ) : /* Start the Loop */ - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /** * Run the loop for the search to output the results. @@ -39,13 +40,16 @@ get_header(); ?> endwhile; // End of the loop. - the_posts_pagination( array( - 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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>', - ) ); + the_posts_pagination( + array( + 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous 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 : + ?> <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyseventeen' ); ?></p> <?php @@ -59,4 +63,5 @@ get_header(); ?> <?php get_sidebar(); ?> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/single.php b/wp-content/themes/twentyseventeen/single.php index f44f486951859ad495e06fbc0fdfc4e56657c4f2..b5136a2133c2b365470f94d9c537907888a7fb56 100644 --- a/wp-content/themes/twentyseventeen/single.php +++ b/wp-content/themes/twentyseventeen/single.php @@ -18,7 +18,8 @@ get_header(); ?> <?php /* Start the Loop */ - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); get_template_part( 'template-parts/post/content', get_post_format() ); @@ -27,10 +28,12 @@ get_header(); ?> comments_template(); endif; - the_post_navigation( array( - 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>', - 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>', - ) ); + the_post_navigation( + array( + 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>', + 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>', + ) + ); endwhile; // End of the loop. ?> @@ -40,4 +43,5 @@ get_header(); ?> <?php get_sidebar(); ?> </div><!-- .wrap --> -<?php get_footer(); +<?php +get_footer(); diff --git a/wp-content/themes/twentyseventeen/style.css b/wp-content/themes/twentyseventeen/style.css index 09425f2c844539abef80a3ce48de02682fecc890..3a3ea51203626b43d6c4d800c0b3f6e56d414d87 100644 --- a/wp-content/themes/twentyseventeen/style.css +++ b/wp-content/themes/twentyseventeen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyseventeen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device. -Version: 1.6 +Version: 1.7 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: twentyseventeen diff --git a/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php b/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php index 1a4c2883310ee23ecd871b8a05b0491f44956e84..e27e7c64178912d738679d0f5575664b46c22749 100644 --- a/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php +++ b/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php @@ -12,17 +12,20 @@ <?php if ( is_active_sidebar( 'sidebar-2' ) || - is_active_sidebar( 'sidebar-3' ) ) : + is_active_sidebar( 'sidebar-3' ) ) : ?> <aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'twentyseventeen' ); ?>"> <?php - if ( is_active_sidebar( 'sidebar-2' ) ) { ?> + if ( is_active_sidebar( 'sidebar-2' ) ) { + ?> <div class="widget-column footer-widget-1"> <?php dynamic_sidebar( 'sidebar-2' ); ?> </div> - <?php } - if ( is_active_sidebar( 'sidebar-3' ) ) { ?> + <?php + } + if ( is_active_sidebar( 'sidebar-3' ) ) { + ?> <div class="widget-column footer-widget-2"> <?php dynamic_sidebar( 'sidebar-3' ); ?> </div> diff --git a/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php b/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php index 2c2115e60b2614688295d4c0026667e23f7d71f9..5cfc99876c65d980f0ad8ca67710ac66a0dc5712 100644 --- a/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php +++ b/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php @@ -18,10 +18,14 @@ ?> </button> - <?php wp_nav_menu( array( - 'theme_location' => 'top', - 'menu_id' => 'top-menu', - ) ); ?> + <?php + wp_nav_menu( + array( + 'theme_location' => 'top', + 'menu_id' => 'top-menu', + ) + ); + ?> <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?> <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a> diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php index 79e11949b9520b8e0f1e13a7581aaa01298d9157..2fcd59f7b4552c6a8238ab831a4b07344ff6111c 100644 --- a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php @@ -14,7 +14,8 @@ global $twentyseventeencounter; <article id="panel<?php echo $twentyseventeencounter; ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> > - <?php if ( has_post_thumbnail() ) : + <?php + if ( has_post_thumbnail() ) : $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); // Calculate aspect ratio: h / w * 100%. @@ -39,32 +40,39 @@ global $twentyseventeencounter; <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); ?> </div><!-- .entry-content --> <?php // Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int). - if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : ?> - - <?php // Show four most recent posts. - $recent_posts = new WP_Query( array( - 'posts_per_page' => 3, - 'post_status' => 'publish', - 'ignore_sticky_posts' => true, - 'no_found_rows' => true, - ) ); + if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : + ?> + + <?php + // Show three most recent posts. + $recent_posts = new WP_Query( + array( + 'posts_per_page' => 3, + 'post_status' => 'publish', + 'ignore_sticky_posts' => true, + 'no_found_rows' => true, + ) + ); ?> - <?php if ( $recent_posts->have_posts() ) : ?> + <?php if ( $recent_posts->have_posts() ) : ?> <div class="recent-posts"> <?php - while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); + while ( $recent_posts->have_posts() ) : + $recent_posts->the_post(); get_template_part( 'template-parts/post/content', 'excerpt' ); endwhile; wp_reset_postdata(); diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php index 84a0d7e4487a9ace4bacdfcdfd1fba593503ef82..a745c950d3dc5e53f7d541dbb5ba6a5dc16c056a 100644 --- a/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-front-page.php @@ -11,7 +11,8 @@ ?> <article id="post-<?php the_ID(); ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> > - <?php if ( has_post_thumbnail() ) : + <?php + if ( has_post_thumbnail() ) : $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); // Calculate aspect ratio: h / w * 100%. @@ -36,10 +37,12 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); ?> </div><!-- .entry-content --> diff --git a/wp-content/themes/twentyseventeen/template-parts/page/content-page.php b/wp-content/themes/twentyseventeen/template-parts/page/content-page.php index 4c470acfbefeddf92b236f35ee3f8b22aedeb384..cc054a0885d83b9d74b3db87c925838b62a4b988 100644 --- a/wp-content/themes/twentyseventeen/template-parts/page/content-page.php +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-page.php @@ -21,10 +21,12 @@ <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + ) + ); ?> </div><!-- .entry-content --> </article><!-- #post-## --> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php b/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php index 63cf2e54cb7865124e9e7d2c78f7f8290e50148e..627c0ff2d7da8f7d3e2b85a4bf87098c8d07fab4 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php @@ -14,41 +14,41 @@ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php - if ( is_sticky() && is_home() ) { - echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); - } + if ( is_sticky() && is_home() ) { + echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); + } ?> <header class="entry-header"> <?php - if ( 'post' === get_post_type() ) { - echo '<div class="entry-meta">'; - if ( is_single() ) { - twentyseventeen_posted_on(); - } else { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); - }; - echo '</div><!-- .entry-meta -->'; - }; - + if ( 'post' === get_post_type() ) { + echo '<div class="entry-meta">'; if ( is_single() ) { - the_title( '<h1 class="entry-title">', '</h1>' ); - } elseif ( is_front_page() && is_home() ) { - the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + twentyseventeen_posted_on(); } else { - the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); - } + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo '</div><!-- .entry-meta -->'; + }; + + if ( is_single() ) { + the_title( '<h1 class="entry-title">', '</h1>' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + } else { + the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); + } ?> </header><!-- .entry-header --> <?php $content = apply_filters( 'the_content', get_the_content() ); - $audio = false; + $audio = false; // Only get audio from the content if a playlist isn't present. - if ( false === strpos( $content, 'wp-playlist-script' ) ) { - $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); - } + if ( false === strpos( $content, 'wp-playlist-script' ) ) { + $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); + } ?> @@ -79,17 +79,21 @@ if ( is_single() || empty( $audio ) ) { /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - 'link_before' => '<span class="page-number">', - 'link_after' => '</span>', - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + 'link_before' => '<span class="page-number">', + 'link_after' => '</span>', + ) + ); }; ?> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php b/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php index a552fba0cdcf46c1acfa398cd687335cc03b36fc..0c640b6eadce0e001fc666c6c67afa3b248e2580 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php @@ -30,13 +30,15 @@ </div><!-- .entry-meta --> <?php endif; ?> - <?php if ( is_front_page() && ! is_home() ) { + <?php + if ( is_front_page() && ! is_home() ) { // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2. the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); } else { the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); - } ?> + } + ?> </header><!-- .entry-header --> <div class="entry-summary"> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php b/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php index f5934e136d591759a47342c3008b857ab564a868..0ede45c4c3bf01b27f8d6189f28835297f1d8b1f 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php @@ -22,12 +22,12 @@ <?php if ( 'post' === get_post_type() ) { echo '<div class="entry-meta">'; - if ( is_single() ) { - twentyseventeen_posted_on(); - } else { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); - }; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; echo '</div><!-- .entry-meta -->'; }; @@ -66,17 +66,21 @@ if ( is_single() || ! get_post_gallery() ) { /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - 'link_before' => '<span class="page-number">', - 'link_after' => '</span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + 'link_before' => '<span class="page-number">', + 'link_after' => '</span>', + ) + ); }; ?> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-image.php b/wp-content/themes/twentyseventeen/template-parts/post/content-image.php index 91c6545065c96dc27e78b3e2fc6108c4a51a32df..e577b4b9a63549aa3b31a694a38aef882d3f8724 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-image.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-image.php @@ -14,30 +14,30 @@ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php - if ( is_sticky() && is_home() ) { - echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); - } + if ( is_sticky() && is_home() ) { + echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); + } ?> <header class="entry-header"> <?php - if ( 'post' === get_post_type() ) { - echo '<div class="entry-meta">'; - if ( is_single() ) { - twentyseventeen_posted_on(); - } else { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); - }; - echo '</div><!-- .entry-meta -->'; - }; - + if ( 'post' === get_post_type() ) { + echo '<div class="entry-meta">'; if ( is_single() ) { - the_title( '<h1 class="entry-title">', '</h1>' ); - } elseif ( is_front_page() && is_home() ) { - the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + twentyseventeen_posted_on(); } else { - the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); - } + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo '</div><!-- .entry-meta -->'; + }; + + if ( is_single() ) { + the_title( '<h1 class="entry-title">', '</h1>' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + } else { + the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); + } ?> </header><!-- .entry-header --> @@ -51,21 +51,26 @@ <div class="entry-content"> - <?php if ( is_single() || '' === get_the_post_thumbnail() ) { + <?php + if ( is_single() || '' === get_the_post_thumbnail() ) { // Only show content if is a single post, or if there's no featured image. /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - 'link_before' => '<span class="page-number">', - 'link_after' => '</span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + 'link_before' => '<span class="page-number">', + 'link_after' => '</span>', + ) + ); }; ?> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-none.php b/wp-content/themes/twentyseventeen/template-parts/post/content-none.php index c42941bb8d92b8985162a758f709f1f89de4e0e1..9654c1e97449b6e92976e057acbc4bd885f63e18 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-none.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-none.php @@ -18,7 +18,8 @@ </header> <div class="page-content"> <?php - if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> + if ( is_home() && current_user_can( 'publish_posts' ) ) : + ?> <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyseventeen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> @@ -28,6 +29,7 @@ <?php get_search_form(); - endif; ?> + endif; + ?> </div><!-- .page-content --> </section><!-- .no-results --> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content-video.php b/wp-content/themes/twentyseventeen/template-parts/post/content-video.php index dad681fb8ec710dd1a0f67c510a1e9ca41f1c77d..67300ada36ceaa586c87d41782adbe2c8b423b3e 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-video.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-video.php @@ -14,41 +14,41 @@ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php - if ( is_sticky() && is_home() ) { - echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); - } + if ( is_sticky() && is_home() ) { + echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); + } ?> <header class="entry-header"> <?php - if ( 'post' === get_post_type() ) { - echo '<div class="entry-meta">'; - if ( is_single() ) { - twentyseventeen_posted_on(); - } else { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); - } - echo '</div><!-- .entry-meta -->'; - }; - + if ( 'post' === get_post_type() ) { + echo '<div class="entry-meta">'; if ( is_single() ) { - the_title( '<h1 class="entry-title">', '</h1>' ); - } elseif ( is_front_page() && is_home() ) { - the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + twentyseventeen_posted_on(); } else { - the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); } + echo '</div><!-- .entry-meta -->'; + }; + + if ( is_single() ) { + the_title( '<h1 class="entry-title">', '</h1>' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); + } else { + the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); + } ?> </header><!-- .entry-header --> <?php $content = apply_filters( 'the_content', get_the_content() ); - $video = false; + $video = false; // Only get video from the content if a playlist isn't present. - if ( false === strpos( $content, 'wp-playlist-script' ) ) { - $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) ); - } + if ( false === strpos( $content, 'wp-playlist-script' ) ) { + $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) ); + } ?> <?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?> @@ -78,17 +78,21 @@ if ( is_single() || empty( $video ) ) { /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - 'link_before' => '<span class="page-number">', - 'link_after' => '</span>', - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + 'link_before' => '<span class="page-number">', + 'link_after' => '</span>', + ) + ); }; ?> diff --git a/wp-content/themes/twentyseventeen/template-parts/post/content.php b/wp-content/themes/twentyseventeen/template-parts/post/content.php index 90c3a4d4c439ec183168cc0f50a7eeed4ce0688d..6881be7675bb5885f95898568b2c536e59899553 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content.php @@ -22,12 +22,12 @@ <?php if ( 'post' === get_post_type() ) { echo '<div class="entry-meta">'; - if ( is_single() ) { - twentyseventeen_posted_on(); - } else { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); - }; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; echo '</div><!-- .entry-meta -->'; }; @@ -52,17 +52,21 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), + get_the_title() + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), - 'after' => '</div>', - 'link_before' => '<span class="page-number">', - 'link_after' => '</span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), + 'after' => '</div>', + 'link_before' => '<span class="page-number">', + 'link_after' => '</span>', + ) + ); ?> </div><!-- .entry-content -->