From f41ed4cc17cb9ebbc229b4126f286873821addc7 Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Sun, 9 Dec 2018 12:18:38 -0800 Subject: [PATCH] [auto] theme: twentyseventeen 1.8 --- wp-content/themes/twentyseventeen/404.php | 3 +- wp-content/themes/twentyseventeen/README.txt | 7 +- wp-content/themes/twentyseventeen/archive.php | 24 +- .../twentyseventeen/assets/css/blocks.css | 297 +++++++ .../assets/css/editor-blocks.css | 797 ++++++++++++++++++ .../themes/twentyseventeen/comments.php | 31 +- wp-content/themes/twentyseventeen/footer.php | 22 +- .../themes/twentyseventeen/front-page.php | 15 +- .../themes/twentyseventeen/functions.php | 211 +++-- .../twentyseventeen/inc/back-compat.php | 8 +- .../twentyseventeen/inc/color-patterns.php | 6 +- .../twentyseventeen/inc/custom-header.php | 76 +- .../themes/twentyseventeen/inc/customizer.php | 194 ++--- .../twentyseventeen/inc/icon-functions.php | 8 +- .../inc/template-functions.php | 4 +- .../twentyseventeen/inc/template-tags.php | 173 ++-- wp-content/themes/twentyseventeen/index.php | 18 +- wp-content/themes/twentyseventeen/page.php | 6 +- wp-content/themes/twentyseventeen/search.php | 21 +- wp-content/themes/twentyseventeen/single.php | 16 +- wp-content/themes/twentyseventeen/style.css | 2 +- .../template-parts/footer/footer-widgets.php | 11 +- .../navigation/navigation-top.php | 12 +- .../page/content-front-page-panels.php | 40 +- .../page/content-front-page.php | 13 +- .../template-parts/page/content-page.php | 10 +- .../template-parts/post/content-audio.php | 72 +- .../template-parts/post/content-excerpt.php | 6 +- .../template-parts/post/content-gallery.php | 36 +- .../template-parts/post/content-image.php | 65 +- .../template-parts/post/content-none.php | 6 +- .../template-parts/post/content-video.php | 70 +- .../template-parts/post/content.php | 36 +- 33 files changed, 1647 insertions(+), 669 deletions(-) create mode 100644 wp-content/themes/twentyseventeen/assets/css/blocks.css create mode 100644 wp-content/themes/twentyseventeen/assets/css/editor-blocks.css diff --git a/wp-content/themes/twentyseventeen/404.php b/wp-content/themes/twentyseventeen/404.php index 3eb2a30bb..4a6d11353 100644 --- a/wp-content/themes/twentyseventeen/404.php +++ b/wp-content/themes/twentyseventeen/404.php @@ -31,5 +31,4 @@ 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 884df3761..c96b5687e 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.7 +Version: 1.8 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.8 = +* Released: December 6, 2018 + +https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.8 + = 1.7 = * Released: August 2, 2018 diff --git a/wp-content/themes/twentyseventeen/archive.php b/wp-content/themes/twentyseventeen/archive.php index 5a024347a..6f9e03c37 100644 --- a/wp-content/themes/twentyseventeen/archive.php +++ b/wp-content/themes/twentyseventeen/archive.php @@ -27,12 +27,10 @@ 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. @@ -43,25 +41,21 @@ 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/blocks.css b/wp-content/themes/twentyseventeen/assets/css/blocks.css new file mode 100644 index 000000000..c71f1d1e4 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/blocks.css @@ -0,0 +1,297 @@ +/* +Theme Name: Twenty Seventeen +Description: Used to style Gutenberg Blocks. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 Blocks - Common Blocks +2.0 Blocks - Formatting +3.0 Blocks - Layout Elements +4.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Block Styles +--------------------------------------------------------------*/ + +/* Captions */ + +[class^="wp-block-"]:not(.wp-block-gallery) figcaption { + font-style: italic; + margin-bottom: 1.5em; + text-align: left; +} + +.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption { + text-align: right; +} + +/*-------------------------------------------------------------- +2.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +p.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; + margin-top: 0.075em; +} + +/* Image */ + +.wp-block-image { + margin-bottom: 1.5em; +} + +.wp-block-image figure { + margin-bottom: 0; + margin-top: 0; +} + +.wp-block-image figure.alignleft { + margin-right: 1.5em; +} + +.wp-block-image figure.alignright { + margin-left: 1.5em; +} + +/* Gallery */ + +.wp-block-gallery { + margin-bottom: 1.5em; +} + +.wp-block-gallery figcaption { + font-style: italic; +} + +.wp-block-gallery.aligncenter { + display: flex; + margin: 0 -8px; +} + +/* Quote */ + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border: 0; + padding: 0; +} + +.wp-block-quote.alignleft p:last-of-type, +.wp-block-quote.alignright p:last-of-type { + margin-bottom: 0; +} + +.wp-block-quote cite { + color: inherit; + font-size: inherit; +} + +/* Audio */ + +.wp-block-audio audio { + display: block; + width: 100%; +} + +/* Cover */ + +.wp-block-cover-image.alignright, +.wp-block-cover.alignright, +.wp-block-cover-image.alignleft, +.wp-block-cover.alignleft, +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { + display: flex; +} + +/* File */ + +.wp-block-file .wp-block-file__button { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.wp-block-file .wp-block-file__button:hover, +.wp-block-file .wp-block-file__button:focus { + background-color: #767676; + -webkit-box-shadow: none; + box-shadow: none; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + background: transparent; + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; +} + +.wp-block-pullquote__citation, +.wp-block-pullquote cite { + font-size: inherit; + text-transform: none; +} + +/* Table */ + +.wp-block-table thead th { + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +.wp-block-table tr { + border-bottom: 1px solid #eee; +} + +.wp-block-table th, +.wp-block-table td { + border: 0; +} + +.rtl .wp-block-table th, +.rtl .wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1.66; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +.wp-block-button .wp-block-button__link:hover, +.wp-block-button .wp-block-button__link:focus { + background-color: #767676; + -webkit-box-shadow: none; + box-shadow: none; +} + +/* Separator */ + +.wp-block-separator { + border: 0; +} + +.wp-block-separator:not(.is-style-wide):not(.is-style-dots) { + max-width: 100px; +} + +/* Media & Text */ + +.wp-block-media-text { + margin-bottom: 1.5em; +} + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +.wp-block-archives.aligncenter, +.wp-block-categories.aligncenter, +.wp-block-latest-posts.aligncenter { + list-style-position: inside; + text-align: center; +} + +/* Comments */ + +.wp-block-latest-comments article { + margin-bottom: 4em; +} + +.blog:not(.has-sidebar) #primary .wp-block-latest-comments article, +.archive:not(.page-one-column):not(.has-sidebar) #primary .wp-block-latest-comments article, +.search:not(.has-sidebar) #primary .wp-block-latest-comments article { + float: none; + width: 100%; +} + +.wp-block-latest-comments .avatar, +.wp-block-latest-comments__comment-avatar { + border-radius: 0; +} + +.wp-block-latest-comments a { + -webkit-box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 1); + +} + +.wp-block-latest-comments__comment-meta { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0.4em; +} + +.wp-block-latest-comments__comment-author, +.wp-block-latest-comments__comment-link { + font-weight: 700; + text-decoration: none; +} + +.wp-block-latest-comments__comment-date { + color: #767676; + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + margin-top: 0.4em; + text-transform: uppercase; +} + +.editor-block-list__block .wp-block-latest-comments__comment-excerpt p { + font-size: 14px; + font-size: 0.875rem; +} diff --git a/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css b/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css new file mode 100644 index 000000000..32cabe1b1 --- /dev/null +++ b/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css @@ -0,0 +1,797 @@ +/* +Theme Name: Twenty Seventeen +Description: Used to style Gutenberg Blocks in the editor. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Typography +2.0 General Block Settings +3.0 Blocks - Common Blocks +4.0 Blocks - Formatting +5.0 Blocks - Layout Elements +6.0 Blocks - Widgets + +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Typography +--------------------------------------------------------------*/ + +.edit-post-visual-editor .editor-block-list__block, +.editor-default-block-appender input[type="text"].editor-default-block-appender__content { + font-size: 15px; + font-size: 0.9375rem; +} + +.editor-default-block-appender input[type="text"].editor-default-block-appender__content { + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; +} + +.edit-post-visual-editor .editor-block-list__block { + color: #333; +} + +.editor-post-title__block .editor-post-title__input { + color: #333; + font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; + font-size: 20px; + font-size: 1.25rem; + font-weight: 300; +} + +@media screen and (min-width: 30em) { + + .edit-post-visual-editor .editor-block-list__block { + font-size: 18px; + font-size: 1.125rem; + } + + .editor-post-title__block .editor-post-title__input { + font-size: 26px; + font-size: 1.625rem; + } + + .edit-post-visual-editor .editor-block-list__block h1 { + font-size: 30px; + font-size: 1.875rem; + } + + .edit-post-visual-editor .editor-block-list__block h2 { + font-size: 26px; + font-size: 1.625rem; + } + + .edit-post-visual-editor .editor-block-list__block h3 { + font-size: 22px; + font-size: 1.375rem; + } + + .edit-post-visual-editor .editor-block-list__block h4 { + font-size: 18px; + font-size: 1.125rem; + } + + .edit-post-visual-editor .editor-block-list__block h5 { + font-size: 13px; + font-size: 0.8125rem; + } + + .edit-post-visual-editor .editor-block-list__block h6 { + font-size: 16px; + font-size: 1rem; + } +} + +@media screen and (min-width: 48em) { + + .edit-post-visual-editor .editor-block-list__block { + font-size: 16px; + font-size: 1rem; + } + + .editor-rich-text__tinymce.mce-content-body { + line-height: 1.5; + } +} + +/* Typography for Arabic Font */ + +html[lang="ar"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ary"] .edit-post-visual-editor .editor-block-list__block, +html[lang="azb"] .edit-post-visual-editor .editor-block-list__block, +html[lang="fa-IR"] .edit-post-visual-editor .editor-block-list__block, +html[lang="haz"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ps"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ur"] .edit-post-visual-editor .editor-block-list__block { + font-family: Tahoma, Arial, sans-serif; +} + +html[lang="ar"] .edit-post-visual-editor h1, +html[lang="ar"] .edit-post-visual-editor h2, +html[lang="ar"] .edit-post-visual-editor h3, +html[lang="ar"] .edit-post-visual-editor h4, +html[lang="ar"] .edit-post-visual-editor h5, +html[lang="ar"] .edit-post-visual-editor h6, +html[lang="ary"] .edit-post-visual-editor h1, +html[lang="ary"] .edit-post-visual-editor h2, +html[lang="ary"] .edit-post-visual-editor h3, +html[lang="ary"] .edit-post-visual-editor h4, +html[lang="ary"] .edit-post-visual-editor h5, +html[lang="ary"] .edit-post-visual-editor h6, +html[lang="azb"] .edit-post-visual-editor h1, +html[lang="azb"] .edit-post-visual-editor h2, +html[lang="azb"] .edit-post-visual-editor h3, +html[lang="azb"] .edit-post-visual-editor h4, +html[lang="azb"] .edit-post-visual-editor h5, +html[lang="azb"] .edit-post-visual-editor h6, +html[lang="fa-IR"] .edit-post-visual-editor h1, +html[lang="fa-IR"] .edit-post-visual-editor h2, +html[lang="fa-IR"] .edit-post-visual-editor h3, +html[lang="fa-IR"] .edit-post-visual-editor h4, +html[lang="fa-IR"] .edit-post-visual-editor h5, +html[lang="fa-IR"] .edit-post-visual-editor h6, +html[lang="haz"] .edit-post-visual-editor h1, +html[lang="haz"] .edit-post-visual-editor h2, +html[lang="haz"] .edit-post-visual-editor h3, +html[lang="haz"] .edit-post-visual-editor h4, +html[lang="haz"] .edit-post-visual-editor h5, +html[lang="haz"] .edit-post-visual-editor h6, +html[lang="ps"] .edit-post-visual-editor h1, +html[lang="ps"] .edit-post-visual-editor h2, +html[lang="ps"] .edit-post-visual-editor h3, +html[lang="ps"] .edit-post-visual-editor h4, +html[lang="ps"] .edit-post-visual-editor h5, +html[lang="ps"] .edit-post-visual-editor h6, +html[lang="ur"] .edit-post-visual-editor h1, +html[lang="ur"] .edit-post-visual-editor h2, +html[lang="ur"] .edit-post-visual-editor h3, +html[lang="ur"] .edit-post-visual-editor h4, +html[lang="ur"] .edit-post-visual-editor h5, +html[lang="ur"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Chinese Font */ + +html[lang^="zh-"] .edit-post-visual-editor .editor-block-list__block, +html[lang="zh-CN"] .edit-post-visual-editor .editor-block-list__block { + font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif; +} + +html[lang^="zh-"] .edit-post-visual-editor h1, +html[lang^="zh-"] .edit-post-visual-editor h2, +html[lang^="zh-"] .edit-post-visual-editor h3, +html[lang^="zh-"] .edit-post-visual-editor h4, +html[lang^="zh-"] .edit-post-visual-editor h5, +html[lang^="zh-"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Cyrillic Font */ + +html[lang="bg-BG"] .edit-post-visual-editor .editor-block-list__block, +html[lang="ru-RU"] .edit-post-visual-editor .editor-block-list__block, +html[lang="uk"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif; +} + +html[lang="bg-BG"] .edit-post-visual-editor h1, +html[lang="bg-BG"] .edit-post-visual-editor h2, +html[lang="bg-BG"] .edit-post-visual-editor h3, +html[lang="bg-BG"] .edit-post-visual-editor h4, +html[lang="bg-BG"] .edit-post-visual-editor h5, +html[lang="bg-BG"] .edit-post-visual-editor h6, +html[lang="ru-RU"] .edit-post-visual-editor h1, +html[lang="ru-RU"] .edit-post-visual-editor h2, +html[lang="ru-RU"] .edit-post-visual-editor h3, +html[lang="ru-RU"] .edit-post-visual-editor h4, +html[lang="ru-RU"] .edit-post-visual-editor h5, +html[lang="ru-RU"] .edit-post-visual-editor h6, +html[lang="uk"] .edit-post-visual-editor h1, +html[lang="uk"] .edit-post-visual-editor h2, +html[lang="uk"] .edit-post-visual-editor h3, +html[lang="uk"] .edit-post-visual-editor h4, +html[lang="uk"] .edit-post-visual-editor h5, +html[lang="uk"] .edit-post-visual-editor h6 { + font-weight: 700; + line-height: 1.2; +} + +/* Typography for Devanagari Font */ + +html[lang="bn-BD"] .edit-post-visual-editor .editor-block-list__block, +html[lang="hi-IN"] .edit-post-visual-editor .editor-block-list__block, +html[lang="mr-IN"] .edit-post-visual-editor .editor-block-list__block { + font-family: Arial, sans-serif; +} + +html[lang="bn-BD"] .edit-post-visual-editor h1, +html[lang="bn-BD"] .edit-post-visual-editor h2, +html[lang="bn-BD"] .edit-post-visual-editor h3, +html[lang="bn-BD"] .edit-post-visual-editor h4, +html[lang="bn-BD"] .edit-post-visual-editor h5, +html[lang="bn-BD"] .edit-post-visual-editor h6, +html[lang="hi-IN"] .edit-post-visual-editor h1, +html[lang="hi-IN"] .edit-post-visual-editor h2, +html[lang="hi-IN"] .edit-post-visual-editor h3, +html[lang="hi-IN"] .edit-post-visual-editor h4, +html[lang="hi-IN"] .edit-post-visual-editor h5, +html[lang="hi-IN"] .edit-post-visual-editor h6, +html[lang="mr-IN"] .edit-post-visual-editor h1, +html[lang="mr-IN"] .edit-post-visual-editor h2, +html[lang="mr-IN"] .edit-post-visual-editor h3, +html[lang="mr-IN"] .edit-post-visual-editor h4, +html[lang="mr-IN"] .edit-post-visual-editor h5, +html[lang="mr-IN"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Greek Font */ + +html[lang="el"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="el"] .edit-post-visual-editor h1, +html[lang="el"] .edit-post-visual-editor h2, +html[lang="el"] .edit-post-visual-editor h3, +html[lang="el"] .edit-post-visual-editor h4, +html[lang="el"] .edit-post-visual-editor h5, +html[lang="el"] .edit-post-visual-editor h6 { + font-weight: 700; + line-height: 1.3; +} + +/* Typography for Gujarati Font */ + +html[lang="gu-IN"] .edit-post-visual-editor .editor-block-list__block { + font-family: Arial, sans-serif; +} + +html[lang="gu-IN"] .edit-post-visual-editor h1, +html[lang="gu-IN"] .edit-post-visual-editor h2, +html[lang="gu-IN"] .edit-post-visual-editor h3, +html[lang="gu-IN"] .edit-post-visual-editor h4, +html[lang="gu-IN"] .edit-post-visual-editor h5, +html[lang="gu-IN"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Hebrew Font */ + +html[lang="he-IL"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Arial Hebrew", Arial, sans-serif; +} + +html[lang="he-IL"] .edit-post-visual-editor h1, +html[lang="he-IL"] .edit-post-visual-editor h2, +html[lang="he-IL"] .edit-post-visual-editor h3, +html[lang="he-IL"] .edit-post-visual-editor h4, +html[lang="he-IL"] .edit-post-visual-editor h5, +html[lang="he-IL"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Japanese Font */ + +html[lang="ja"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Hiragino Kaku Gothic Pro", Meiryo, sans-serif; +} + +html[lang="ja"] .edit-post-visual-editor h1, +html[lang="ja"] .edit-post-visual-editor h2, +html[lang="ja"] .edit-post-visual-editor h3, +html[lang="ja"] .edit-post-visual-editor h4, +html[lang="ja"] .edit-post-visual-editor h5, +html[lang="ja"] .edit-post-visual-editor h6 { + font-weight: 700; +} + +/* Typography for Korean font */ + +html[lang="ko-KR"] .edit-post-visual-editor .editor-block-list__block { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + +html[lang="ko-KR"] .edit-post-visual-editor h1, +html[lang="ko-KR"] .edit-post-visual-editor h2, +html[lang="ko-KR"] .edit-post-visual-editor h3, +html[lang="ko-KR"] .edit-post-visual-editor h4, +html[lang="ko-KR"] .edit-post-visual-editor h5, +html[lang="ko-KR"] .edit-post-visual-editor h6 { + font-weight: 600; +} + +/* Typography for Thai Font */ + +html[lang="th"] .edit-post-visual-editor .editor-block-list__block { + line-height: 1.8; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +html[lang="th"] .edit-post-visual-editor h1, +html[lang="th"] .edit-post-visual-editor h2, +html[lang="th"] .edit-post-visual-editor h3, +html[lang="th"] .edit-post-visual-editor h4, +html[lang="th"] .edit-post-visual-editor h5, +html[lang="th"] .edit-post-visual-editor h6 { + line-height: 1.65; + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* Remove letter-spacing for all non-latin alphabets */ + +html[lang="ar"] .edit-post-visual-editor *, +html[lang="ary"] .edit-post-visual-editor *, +html[lang="azb"] .edit-post-visual-editor *, +html[lang="haz"] .edit-post-visual-editor *, +html[lang="ps"] .edit-post-visual-editor *, +html[lang^="zh-"] .edit-post-visual-editor *, +html[lang="bg-BG"] .edit-post-visual-editor *, +html[lang="ru-RU"] .edit-post-visual-editor *, +html[lang="uk"] .edit-post-visual-editor *, +html[lang="bn-BD"] .edit-post-visual-editor *, +html[lang="hi-IN"] .edit-post-visual-editor *, +html[lang="mr-IN"] .edit-post-visual-editor *, +html[lang="el"] .edit-post-visual-editor *, +html[lang="gu-IN"] .edit-post-visual-editor *, +html[lang="he-IL"] .edit-post-visual-editor *, +html[lang="ja"] .edit-post-visual-editor *, +html[lang="ko-KR"] .edit-post-visual-editor *, +html[lang="th"] .edit-post-visual-editor * { + letter-spacing: 0 !important; +} + +/*-------------------------------------------------------------- +2.0 General Block Settings +--------------------------------------------------------------*/ + +/* Main column width */ + +.editor-styles-wrapper { + max-width: 100% !important; /* Override where editor-style.css is affecting this. */ +} + +.wp-block { + max-width: 674px; /* Based on one-column post width; 644px + 30px to account for padding. */ +} + +/* Background color */ + +.gutenberg-editor-page .editor-block-list__block { + background-color: transparent; +} + +/* Alignments */ + +.edit-post-visual-editor .alignleft { + margin-right: 1.5em; +} + +.edit-post-visual-editor .alignright { + margin-left: 1.5em; +} + +/* Link styles */ + +.edit-post-visual-editor a, +.editor-block-list__block a, +.wp-block-freeform.block-library-rich-text__tinymce a { + color: #222; +} + +/* List styles */ + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul, +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol, +.block-library-list .editor-rich-text__tinymce { + margin: 0 0 1.5em 1.5em; + padding: 0; +} + +.edit-post-visual-editor ul:not(.wp-block-gallery), +.editor-block-list__block ul:not(.wp-block-gallery), +.block-library-list ul { + list-style: disc; +} + +.edit-post-visual-editor ol, +.editor-block-list__block ol, +.block-library-list ol { + list-style: decimal; +} + +.edit-post-visual-editor li > ul:not(.wp-block-gallery), +.editor-block-list__block li > ul:not(.wp-block-gallery), +.block-library-list li > ul:not(.wp-block-gallery), +.edit-post-visual-editor li > ol, +.editor-block-list__block li > ol, +.block-library-list li > ol { + margin-bottom: 0; + margin-left: 1.5em; +} + +.edit-post-visual-editor li, +.editor-block-list__block li, +.block-library-list li { + margin: 0; +} + +.rtl .edit-post-visual-editor ul:not(.wp-block-gallery), +.rtl .editor-block-list__block ul:not(.wp-block-gallery), +.rtl .block-library-list ul, +.rtl .edit-post-visual-editor ol, +.rtl .editor-block-list__block ol, +.rtl .block-library-list ol, +.rtl .block-library-list .editor-rich-text__tinymce, +.rtl .edit-post-visual-editor li > ul:not(.wp-block-gallery), +.rtl .editor-block-list__block li > ul:not(.wp-block-gallery), +.rtl .block-library-list li > ul:not(.wp-block-gallery), +.rtl .edit-post-visual-editor li > ol, +.rtl .editor-block-list__block li > ol, +.rtl .block-library-list li > ol { + margin-left: 1.5em; + margin-right: 1.5em; +} + +/* Quote styles */ + +.editor-block-list__block blockquote p { + font-size: 18px; + font-size: 1.125rem; +} + +.editor-block-list__block blockquote.alignright p, +.editor-block-list__block blockquote.alignleft p { + font-size: 13px; + font-size: 0.8125rem; +} + +.editor-block-list__block blockquote cite { + display: block; + font-style: normal; + font-weight: 600; + margin-top: 0.5em; +} + +/* Caption styles*/ + +[class^="wp-block-"]:not(.wp-block-gallery) figcaption { + font-style: italic; + margin-bottom: 1.5em; + text-align: left; +} + +.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption { + text-align: right; +} + +/* Code styles */ + +.wp-block-freeform.block-library-rich-text__tinymce code { + background: transparent; +} + +/* Table styles */ + +.rtl .editor-block-list__block th { + text-align: right; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +.wp-block-paragraph.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; + margin-top: 0.075em; +} + +/* Gallery */ + +.wp-block-gallery figcaption { + font-style: italic; +} + +/* Quote */ + +.wp-block-quote { + color: #666; + font-size: 18px; + font-size: 1.125rem; + font-style: italic; + line-height: 1.7; +} + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border: 0; + padding: 0; +} + +.editor-block-list__block .wp-block-quote .wp-block-quote__citation { + color: inherit; + display: block; + font-size: inherit; + font-style: normal; + font-weight: 600; + margin-top: 0.5em; +} + +.wp-block-quote.alignleft, +.wp-block-quote.alignright { + color: #666; + width: 48%; +} + +.editor-block-list__block .wp-block-quote.alignleft p, +.editor-block-list__block .wp-block-quote.alignright p, +.editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, +.editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation { + font-size: 13px; + font-size: 0.8125rem; +} + +.editor-block-list__block .wp-block-quote.alignleft p:last-of-type, +.editor-block-list__block .wp-block-quote.alignright p:last-of-type { + margin-bottom: 0; +} + +.wp-block-quote.is-large .wp-block-quote__citation, +.wp-block-quote.is-style-large .wp-block-quote__citation { + text-align: right; +} + +.rtl .wp-block-quote.is-large .wp-block-quote__citation, +.rtl .wp-block-quote.is-style-large .wp-block-quote__citation { + text-align: left; +} + +@media screen and (min-width: 30em) { + .editor-block-list__block .wp-block-quote.alignleft p, + .editor-block-list__block .wp-block-quote.alignright p, + .editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote footer { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 48em) { + .editor-block-list__block .wp-block-quote.alignleft p, + .editor-block-list__block .wp-block-quote.alignright p, + .editor-block-list__block .wp-block-quote.alignleft .wp-block-quote__citation, + .editor-block-list__block .wp-block-quote.alignright .wp-block-quote__citation { + font-size: 13px; + font-size: 0.8125rem; + } + + .editor-block-list__block .wp-block-quote.alignleft { + margin-left: -17.5%; + width: 48%; + } + + .editor-block-list__block .wp-block-quote.alignright { + margin-right: -17.5%; + width: 48%; + } +} + +/* File */ + +.wp-block-file .wp-block-file__textlink { + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 1px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 1px 0 rgba(0, 0, 0, 1); +} + +.wp-block-file .wp-block-file__button { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + padding: 0; +} + +/* Classic */ + +.wp-block-freeform.block-library-rich-text__tinymce li, +.wp-block-freeform.block-library-rich-text__tinymce p { + line-height: 1.5; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote { + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; +} + +.wp-block-pullquote.alignleft blockquote > .editor-rich-text p, +.wp-block-pullquote.alignright blockquote > .editor-rich-text p { + font-size: 20px; +} + + +.wp-block-pullquote .wp-block-pullquote__citation { + font-size: inherit; + font-weight: 600; + text-transform: none; +} + +/* Table */ + +table.wp-block-table { + border-collapse: collapse; + margin: 0 0 1.5em; + width: 100%; +} + +table.wp-block-table thead th { + border: 0; + border-bottom: 2px solid #bbb; + padding-bottom: 0.5em; +} + +table.wp-block-table th { + padding: 0.4em; + text-align: left; +} + +table.wp-block-table tr { + border-bottom: 1px solid #eee; +} + +table.wp-block-table td { + border: 0; + padding: 0.4em; +} + +table.wp-block-table th:first-child, +table.wp-block-table td:first-child { + padding-left: 0; +} + +table.wp-block-table th:last-child, +table.wp-block-table td:last-child { + padding-right: 0; +} + +.wp-block-table__cell-content { + padding: 0; +} + +.rtl table.wp-block-table th, +.rtl table.wp-block-table td { + text-align: right; +} + +/*-------------------------------------------------------------- +5.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Separator */ + +.edit-post-visual-editor .wp-block-separator { + border: 0; +} + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + background-color: #222; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + color: #fff; + display: inline-block; + font-size: 14px; + font-size: 0.875rem; + font-weight: 800; + line-height: 1.66; + margin-top: 2em; + padding: 0.7em 2em; + -webkit-transition: background-color 0.2s ease-in-out; + transition: background-color 0.2s ease-in-out; + white-space: nowrap; +} + +/* Media & Text */ + +.wp-block-media-text *:last-child { + margin-bottom: 0; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Widgets +--------------------------------------------------------------*/ + +/* Archives, Categories & Latest Posts */ + +[data-align="center"] .wp-block-archives ul, +[data-align="center"] .wp-block-categories ul, +[data-align="center"] .wp-block-latest-posts ul { + list-style-position: inside; +} + +/* Latest Comments */ + +.editor-block-list__block ol.wp-block-latest-comments > li:before { + content: ''; +} + +.wp-block-latest-comments article { + margin-bottom: 4em; +} + +.wp-block-latest-comments .avatar, +.wp-block-latest-comments__comment-avatar { + border-radius: 0; +} + +.wp-block-latest-comments__comment-meta { + font-size: 16px; + font-size: 1rem; + margin-bottom: 0.4em; +} + +.editor-block-list__block .wp-block-latest-comments__comment-meta a { + -webkit-box-shadow: none; + box-shadow: none; + font-weight: 700; +} + +.wp-block-latest-comments__comment-date { + color: #767676; + font-size: 10px; + font-size: 0.625rem; + font-weight: 800; + letter-spacing: 0.1818em; + margin-top: 0.4em; + text-transform: uppercase; +} + +.editor-block-list__block .wp-block-latest-comments__comment-excerpt p { + font-size: 14px; + font-size: 0.875rem; +} + +/* Latest Posts */ + +.edit-post-visual-editor .wp-block-latest-posts.is-grid { + list-style: none; + margin-left: 0; + margin-right: 0; +} diff --git a/wp-content/themes/twentyseventeen/comments.php b/wp-content/themes/twentyseventeen/comments.php index a8c8f287a..f93c09eaf 100644 --- a/wp-content/themes/twentyseventeen/comments.php +++ b/wp-content/themes/twentyseventeen/comments.php @@ -27,8 +27,7 @@ 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(); @@ -54,30 +53,24 @@ 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 8d8086fff..504f573f8 100644 --- a/wp-content/themes/twentyseventeen/footer.php +++ b/wp-content/themes/twentyseventeen/footer.php @@ -21,23 +21,19 @@ <?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 460c942ac..bb593f6ac 100644 --- a/wp-content/themes/twentyseventeen/front-page.php +++ b/wp-content/themes/twentyseventeen/front-page.php @@ -17,17 +17,14 @@ get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> - <?php - // Show the selected front page content. + <?php // Show the selected frontpage 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. @@ -49,11 +46,9 @@ 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 2e147a92d..524e4e43f 100644 --- a/wp-content/themes/twentyseventeen/functions.php +++ b/wp-content/themes/twentyseventeen/functions.php @@ -59,51 +59,43 @@ 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' ); @@ -111,12 +103,21 @@ 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() ) ); + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + // 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', @@ -137,15 +138,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( @@ -157,27 +158,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}}', @@ -185,10 +186,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', @@ -199,7 +200,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', @@ -319,41 +320,35 @@ 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' ); @@ -371,8 +366,7 @@ 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() ) ) @@ -413,17 +407,11 @@ 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 echo $customize_preview_data_hue; ?>> + <style type="text/css" id="custom-theme-colors" <?php if ( is_customize_preview() ) { echo 'data-hue="' . $hue . '"'; } ?>> <?php echo twentyseventeen_custom_colors_css(); ?> </style> -<?php -} +<?php } add_action( 'wp_head', 'twentyseventeen_colors_css_wrap' ); /** @@ -436,6 +424,9 @@ function twentyseventeen_scripts() { // Theme stylesheet. wp_enqueue_style( 'twentyseventeen-style', get_stylesheet_uri() ); + // Theme block stylesheet. + wp_enqueue_style( 'twentyseventeen-block-style', get_theme_file_uri( '/assets/css/blocks.css' ), array( 'twentyseventeen-style' ), '1.0' ); + // Load the dark colorscheme. if ( 'dark' === get_theme_mod( 'colorscheme', 'light' ) || is_customize_preview() ) { wp_enqueue_style( 'twentyseventeen-colors-dark', get_theme_file_uri( '/assets/css/colors-dark.css' ), array( 'twentyseventeen-style' ), '1.0' ); @@ -458,19 +449,14 @@ 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 ); @@ -485,6 +471,19 @@ function twentyseventeen_scripts() { } add_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' ); +/** + * Enqueue editor styles for Gutenberg + * + * @since Twenty Seventeen 1.8 + */ +function twentyseventeen_block_editor_styles() { + // Block styles. + wp_enqueue_style( 'twentyseventeen-block-editor-style', get_theme_file_uri( '/assets/css/editor-blocks.css' ) ); + // Add custom fonts. + wp_enqueue_style( 'twentyseventeen-fonts', twentyseventeen_fonts_url(), array(), null ); +} +add_action( 'enqueue_block_editor_assets', 'twentyseventeen_block_editor_styles' ); + /** * Add custom image sizes attribute to enhance responsive image functionality * for content images. @@ -505,7 +504,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'; } } @@ -565,7 +564,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 fad87f91b..4772f5621 100644 --- a/wp-content/themes/twentyseventeen/inc/back-compat.php +++ b/wp-content/themes/twentyseventeen/inc/back-compat.php @@ -48,11 +48,9 @@ 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 ddd25d089..3f1ecddd0 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 1cc6114a9..6e19a7f98 100644 --- a/wp-content/themes/twentyseventeen/inc/custom-header.php +++ b/wp-content/themes/twentyseventeen/inc/custom-header.php @@ -24,59 +24,53 @@ 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 ) : ?> @@ -112,7 +106,7 @@ if ( ! function_exists( 'twentyseventeen_header_style' ) ) : <?php endif; ?> </style> <?php - } +} endif; // End of twentyseventeen_header_style. /** @@ -122,7 +116,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 abc27fb05..bc6bbea31 100644 --- a/wp-content/themes/twentyseventeen/inc/customizer.php +++ b/wp-content/themes/twentyseventeen/inc/customizer.php @@ -13,97 +13,77 @@ * @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. @@ -116,33 +96,27 @@ 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 87572bcec..3425f740d 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 b9e0d8828..9ecbe56a8 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 front page or not. + * Checks to see if we're on the homepage 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 8fec665a2..a99230d96 100644 --- a/wp-content/themes/twentyseventeen/inc/template-tags.php +++ b/wp-content/themes/twentyseventeen/inc/template-tags.php @@ -10,84 +10,83 @@ */ 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>'; - } - - $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>' - ); +/** + * 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>' + ); +} 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>'; } @@ -95,32 +94,32 @@ if ( ! function_exists( '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; /** @@ -133,7 +132,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; } @@ -162,14 +161,12 @@ 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 ); @@ -197,4 +194,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 3eab9ff65..78d1b4c93 100644 --- a/wp-content/themes/twentyseventeen/index.php +++ b/wp-content/themes/twentyseventeen/index.php @@ -35,8 +35,7 @@ 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. @@ -47,13 +46,11 @@ 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 : @@ -67,5 +64,4 @@ 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 5d42e2ce4..96211f49d 100644 --- a/wp-content/themes/twentyseventeen/page.php +++ b/wp-content/themes/twentyseventeen/page.php @@ -22,8 +22,7 @@ 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' ); @@ -39,5 +38,4 @@ 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 c2a652746..c6967f203 100644 --- a/wp-content/themes/twentyseventeen/search.php +++ b/wp-content/themes/twentyseventeen/search.php @@ -28,8 +28,7 @@ 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. @@ -40,16 +39,13 @@ 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 @@ -63,5 +59,4 @@ 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 b5136a213..f44f48695 100644 --- a/wp-content/themes/twentyseventeen/single.php +++ b/wp-content/themes/twentyseventeen/single.php @@ -18,8 +18,7 @@ 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() ); @@ -28,12 +27,10 @@ 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. ?> @@ -43,5 +40,4 @@ 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 3a3ea5120..a34976628 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.7 +Version: 1.8 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 e27e7c641..1a4c28833 100644 --- a/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php +++ b/wp-content/themes/twentyseventeen/template-parts/footer/footer-widgets.php @@ -12,20 +12,17 @@ <?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 5cfc99876..2c2115e60 100644 --- a/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php +++ b/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php @@ -18,14 +18,10 @@ ?> </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 2fcd59f7b..79e11949b 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,8 +14,7 @@ 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%. @@ -40,39 +39,32 @@ 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 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, - ) - ); + 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, + ) ); ?> - <?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 a745c950d..84a0d7e44 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,8 +11,7 @@ ?> <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%. @@ -37,12 +36,10 @@ <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 cc054a088..4c470acfb 100644 --- a/wp-content/themes/twentyseventeen/template-parts/page/content-page.php +++ b/wp-content/themes/twentyseventeen/template-parts/page/content-page.php @@ -21,12 +21,10 @@ <?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 627c0ff2d..63cf2e54c 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(); - }; + 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 ( 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>' ); - } + 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,21 +79,17 @@ 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 0c640b6ea..a552fba0c 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php @@ -30,15 +30,13 @@ </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 0ede45c4c..f5934e136 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,21 +66,17 @@ 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 e577b4b9a..91c654506 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(); - }; + 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 ( 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>' ); - } + 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,26 +51,21 @@ <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 9654c1e97..c42941bb8 100644 --- a/wp-content/themes/twentyseventeen/template-parts/post/content-none.php +++ b/wp-content/themes/twentyseventeen/template-parts/post/content-none.php @@ -18,8 +18,7 @@ </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> @@ -29,7 +28,6 @@ <?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 67300ada3..dad681fb8 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 ( '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 ( is_single() ) { - twentyseventeen_posted_on(); + 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 { - echo twentyseventeen_time_link(); - twentyseventeen_edit_link(); + the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); } - 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,21 +78,17 @@ 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 6881be767..90c3a4d4c 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,21 +52,17 @@ <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 --> -- GitLab