From c00d17bd8b26b20be39ada518d07bb5a07478b29 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Tue, 1 Jan 2019 22:14:18 -0500 Subject: Update twentyfourteen 2.4 Signed-off-by: Anthony G. Basile --- themes/twentyfourteen/archive.php | 19 +- themes/twentyfourteen/author.php | 15 +- themes/twentyfourteen/category.php | 21 +- themes/twentyfourteen/comments.php | 46 +- themes/twentyfourteen/content-aside.php | 30 +- themes/twentyfourteen/content-audio.php | 30 +- themes/twentyfourteen/content-featured-post.php | 14 +- themes/twentyfourteen/content-gallery.php | 30 +- themes/twentyfourteen/content-image.php | 30 +- themes/twentyfourteen/content-link.php | 30 +- themes/twentyfourteen/content-page.php | 14 +- themes/twentyfourteen/content-quote.php | 30 +- themes/twentyfourteen/content-video.php | 30 +- themes/twentyfourteen/content.php | 35 +- themes/twentyfourteen/css/blocks.css | 396 +++++++++++++++++ themes/twentyfourteen/css/editor-blocks.css | 479 +++++++++++++++++++++ themes/twentyfourteen/featured-content.php | 8 +- themes/twentyfourteen/footer.php | 2 +- themes/twentyfourteen/functions.php | 448 ++++++++++--------- themes/twentyfourteen/header.php | 10 +- themes/twentyfourteen/image.php | 49 +-- themes/twentyfourteen/inc/back-compat.php | 8 +- themes/twentyfourteen/inc/custom-header.php | 96 ++--- themes/twentyfourteen/inc/customizer.php | 105 ++--- themes/twentyfourteen/inc/featured-content.php | 161 ++++--- themes/twentyfourteen/inc/template-tags.php | 269 ++++++------ themes/twentyfourteen/inc/widgets.php | 151 ++++--- themes/twentyfourteen/index.php | 33 +- themes/twentyfourteen/js/functions.js | 3 +- .../twentyfourteen/page-templates/contributors.php | 31 +- .../twentyfourteen/page-templates/full-width.php | 23 +- themes/twentyfourteen/page.php | 23 +- themes/twentyfourteen/readme.txt | 14 +- themes/twentyfourteen/search.php | 17 +- themes/twentyfourteen/sidebar.php | 2 +- themes/twentyfourteen/single.php | 27 +- themes/twentyfourteen/style.css | 2 +- themes/twentyfourteen/tag.php | 21 +- themes/twentyfourteen/taxonomy-post_format.php | 21 +- 39 files changed, 1805 insertions(+), 968 deletions(-) create mode 100644 themes/twentyfourteen/css/blocks.css create mode 100644 themes/twentyfourteen/css/editor-blocks.css diff --git a/themes/twentyfourteen/archive.php b/themes/twentyfourteen/archive.php index e2b4b414..6a4deed0 100644 --- a/themes/twentyfourteen/archive.php +++ b/themes/twentyfourteen/archive.php @@ -27,8 +27,8 @@ get_header(); ?> @@ -55,13 +55,11 @@ if ( post_password_required() ) {
    'ol', - 'short_ping' => true, - 'avatar_size' => 34, - ) - ); + wp_list_comments( array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 34, + ) ); ?>
diff --git a/themes/twentyfourteen/content-aside.php b/themes/twentyfourteen/content-aside.php index 554416df..0401579d 100644 --- a/themes/twentyfourteen/content-aside.php +++ b/themes/twentyfourteen/content-aside.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-audio.php b/themes/twentyfourteen/content-audio.php index 8fc2095a..9fa9df41 100644 --- a/themes/twentyfourteen/content-audio.php +++ b/themes/twentyfourteen/content-audio.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-featured-post.php b/themes/twentyfourteen/content-featured-post.php index d5a16fef..6cc88224 100644 --- a/themes/twentyfourteen/content-featured-post.php +++ b/themes/twentyfourteen/content-featured-post.php @@ -12,12 +12,12 @@ @@ -29,6 +29,6 @@ - ', '' ); ?> + ','' ); ?> diff --git a/themes/twentyfourteen/content-gallery.php b/themes/twentyfourteen/content-gallery.php index db382fef..6e3fe832 100644 --- a/themes/twentyfourteen/content-gallery.php +++ b/themes/twentyfourteen/content-gallery.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-image.php b/themes/twentyfourteen/content-image.php index 11aa1e8f..a81e493d 100644 --- a/themes/twentyfourteen/content-image.php +++ b/themes/twentyfourteen/content-image.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-link.php b/themes/twentyfourteen/content-link.php index 5c979863..858301ef 100644 --- a/themes/twentyfourteen/content-link.php +++ b/themes/twentyfourteen/content-link.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-page.php b/themes/twentyfourteen/content-page.php index 6a33baa7..98394190 100644 --- a/themes/twentyfourteen/content-page.php +++ b/themes/twentyfourteen/content-page.php @@ -18,14 +18,12 @@
'', - 'link_before' => '', - 'link_after' => '', - ) - ); + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); edit_post_link( __( 'Edit', 'twentyfourteen' ), '', '' ); ?> diff --git a/themes/twentyfourteen/content-quote.php b/themes/twentyfourteen/content-quote.php index fa0b8992..10a5d112 100644 --- a/themes/twentyfourteen/content-quote.php +++ b/themes/twentyfourteen/content-quote.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content-video.php b/themes/twentyfourteen/content-video.php index 951a13cf..4c49aaa1 100644 --- a/themes/twentyfourteen/content-video.php +++ b/themes/twentyfourteen/content-video.php @@ -19,8 +19,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,21 +44,17 @@ if ( is_single() ) :
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) - ); - - wp_link_pages( - array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) - ); + the_content( sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); ?>
diff --git a/themes/twentyfourteen/content.php b/themes/twentyfourteen/content.php index 03eb3e89..e571d8b3 100644 --- a/themes/twentyfourteen/content.php +++ b/themes/twentyfourteen/content.php @@ -21,8 +21,8 @@ ', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -30,11 +30,10 @@ if ( is_single() ) : diff --git a/themes/twentyfourteen/css/blocks.css b/themes/twentyfourteen/css/blocks.css new file mode 100644 index 00000000..425c8dbc --- /dev/null +++ b/themes/twentyfourteen/css/blocks.css @@ -0,0 +1,396 @@ +/* +Theme Name: Twenty Fourteen +Description: Used to style blocks. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Block Styles +2.0 Blocks - Common Blocks +3.0 Blocks - Formatting +4.0 Blocks - Layout Elements +5.0 Blocks - Widgets +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +1.0 General Block Styles +--------------------------------------------------------------*/ + +[class^="wp-block-"] figcaption, +[class^="wp-block-"] figcaption.editor-rich-text__tinymce.mce-content-body { + font-size: 12px; + font-style: italic; + line-height: 1.5; + margin: 9px 0 0; +} + +/* Alignments */ + +[class^="wp-block-"].alignleft, +[class^="wp-block-"] .alignleft { + margin-right: 24px; +} + +[class^="wp-block-"].alignright, +[class^="wp-block-"] .alignright { + margin-left: 24px; +} + +/*-------------------------------------------------------------- +2.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +p.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; +} + +/* Image */ + +.wp-block-image { + margin-bottom: 24px; +} + +.wp-block-image figcaption { + text-align: left; +} + +@media screen and (min-width: 810px) { + .full-width .site-content .wp-block-image figure.alignleft { + margin-left: -168px; + } + + .full-width .site-content .wp-block-image figure.alignright { + margin-right: -168px; + } +} + +.rtl .wp-block-image figcaption { + text-align: right; +} + +/* Gallery */ + +.wp-block-gallery { + margin: 0 0 24px; +} + +.wp-block-gallery .blocks-gallery-image figcaption, +.wp-block-gallery .blocks-gallery-item figcaption { + left: 0; + right: 0; + width: auto; +} + +/* Quote */ + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border-left: 0; + border-right: 0; + padding-left: 0; + padding-right: 0; +} + +.wp-block-quote.is-large, +.wp-block-quote.is-style-large { + padding: 0; +} + +.wp-block-quote cite { + color: #2b2b2b; + font-size: 16px; + font-weight: 400; +} + +.wp-block-quote.alignleft cite, +.wp-block-quote.alignright cite { + display: inline-block; + margin-bottom: 17px; + margin-top: 0; +} + +.rtl .wp-block-quote.alignleft { + margin-right: 24px; +} + +.rtl .wp-block-quote.alignright { + margin-left: 24px; +} + +/* Audio */ + +.wp-block-audio audio { + display: block; + width: 100%; +} + +/* Cover */ + +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { + display: flex; +} + +/* File */ + +.wp-block-file .wp-block-file__button { + background-color: #24890d; + border: 0; + border-radius: 2px; + color: #fff; + font-size: 12px; + font-weight: 700; + line-height: 15px; + padding: 10px 30px 11px; + text-transform: uppercase; + vertical-align: bottom; +} + +.wp-block-file .wp-block-file__button:hover, +.wp-block-file .wp-block-file__button:focus { + background-color: #41a62a; +} + +.wp-block-file .wp-block-file__button:active { + background-color: #55d737; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; + margin: 0; +} + +.wp-block-pullquote cite { + color: #2b2b2b; + font-size: 16px; + font-weight: 400; + margin-top: 0; + text-transform: none; +} + +.wp-block-pullquote.alignleft { + margin-right: 1em; +} + +.wp-block-pullquote.alignright { + margin-right: 1em; +} + +@media screen and (min-width: 810px) { + .full-width .site-content .wp-block-pullquote.alignleft { + margin-left: -168px; + } + + .full-width .site-content .wp-block-pullquote.alignright { + margin-right: -168px; + } +} + +/* Table */ + +.wp-block-table { + overflow-x: visible; +} + +.wp-block-table th, +.wp-block-table td { + border-color: rgba(0, 0, 0, 0.1); + border-width: 0 1px 1px 0; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + border: 0; + border-radius: 2px; + font-size: 12px; + font-weight: 700; + line-height: 15px; + padding: 10px 30px 11px; + text-transform: uppercase; + vertical-align: bottom; +} + +.wp-block-button__link { + background-color: #24890d; + color: #fff; +} + +.wp-block-button__link:hover, +.wp-block-button__link:focus { + background-color: #41a62a; + color: #fff; +} + +.wp-block-button__link:active { + background-color: #55d737; +} + +/* Separator */ + +.wp-block-separator { + border: 0; + max-width: 100px; +} + +.wp-block-separator.is-style-wide { + max-width: 100%; +} + +/* Media & Text */ + +.wp-block-media-text { + margin-bottom: 24px; +} + +.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; + margin-left: 20px; + text-align: center; +} + +.rtl .wp-block-archives.aligncenter, +.rtl .wp-block-categories.aligncenter, +.rtl .wp-block-latest-posts.aligncenter { + margin-left: 0; + margin-right: 20px; +} + +/* Latest Comments */ + +.wp-block-latest-comments { + margin: 0; + padding: 0; +} + +.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt, +.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta { + margin-left: 60px; +} + +.wp-block-latest-comments .avatar, .wp-block-latest-comments__comment-avatar { + border-radius: 0; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 2px; +} + +.wp-block-latest-comments__comment, +.wp-block-latest-comments__comment-excerpt, +.wp-block-latest-comments__comment-excerpt p { + font-size: 16px; +} + +.wp-block-latest-comments__comment-meta a { + color: #2b2b2b; + font-weight: 900; + text-decoration: none; +} + +.wp-block-latest-comments_comment-meta a:hover, +.wp-block-latest-comments_comment-meta a:focus { + color: #41a62a; +} + +.wp-block-latest-comments__comment-excerpt p:last-child { +} + +.wp-block-latest-comments__comment-date { + text-transform: uppercase; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment { + border-top: 1px solid rgba(0, 0, 0, 0.1); + margin-bottom: 24px; + padding-top: 24px; +} + +/* Latest Posts */ + +.wp-block-latest-posts.is-grid { + margin-left: 0; + margin-right: 0; +} + +/*-------------------------------------------------------------- +6.0 Blocks - Colors +--------------------------------------------------------------*/ + +.has-green-color { + color: #24890d; +} + +.has-green-background-color { + background-color: #24890d; +} + +.has-black-color { + color: #000; +} + +.has-black-background-color { + background-color: #000; +} + +.has-dark-gray-color { + color: #2b2b2b; +} + +.has-dark-gray-background-color { + background-color: #2b2b2b; +} + +.has-medium-gray-color { + color: #767676; +} + +.has-medium-gray-background-color { + background-color: #767676; +} + +.has-light-gray-color { + color: #f5f5f5; +} + +.has-light-gray-background-color { + background-color: #f5f5f5; +} + +.has-white-color { + color: #fff; +} + +.has-white-background-color { + background-color: #fff; +} diff --git a/themes/twentyfourteen/css/editor-blocks.css b/themes/twentyfourteen/css/editor-blocks.css new file mode 100644 index 00000000..e8fba395 --- /dev/null +++ b/themes/twentyfourteen/css/editor-blocks.css @@ -0,0 +1,479 @@ +/* +Theme Name: Twenty Fourteen +Description: Used to style blocks in the editor. +*/ + +/*-------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +1.0 General Typography +2.0 General Block Styles +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, +.edit-post-visual-editor .editor-block-list__block p, +.editor-default-block-appender textarea.editor-default-block-appender__content { + font-size: 16px; + line-height: 1.5; +} + +.editor-default-block-appender textarea.editor-default-block-appender__content { + font-family: Lato, sans-serif; +} + +.edit-post-visual-editor .editor-block-list__block { + color: #2b2b2b; +} + +.editor-post-title__block .editor-post-title__input { + font-family: Lato, sans-serif; + font-size: 33px; + font-weight: 300; + line-height: 1.0909090909; + text-transform: uppercase; +} + +/* Headers */ + +.wp-block-freeform.block-library-rich-text__tinymce h1 { + font-size: 26px; +} + +.wp-block-freeform.block-library-rich-text__tinymce h2 { + font-size: 24px; +} + +.wp-block-freeform.block-library-rich-text__tinymce h3 { + font-size: 22px; +} + +.wp-block-freeform.block-library-rich-text__tinymce h4 { + font-size: 20px; +} + +.wp-block-freeform.block-library-rich-text__tinymce h5 { + font-size: 18px; +} + +.wp-block-freeform.block-library-rich-text__tinymce h6 { + font-size: 16px; +} + +/*-------------------------------------------------------------- +2.0 General Block Styles +--------------------------------------------------------------*/ + +/* Main column width */ + +.wp-block { + max-width: 504px; /* 474px + 30px to account for padding */ +} + +/* Link styles */ + +.edit-post-visual-editor a, +.editor-block-list__block a, +.wp-block-freeform.block-library-rich-text__tinymce a { + color: #24890d; +} + +/* List styles */ + +.wp-block-freeform.block-library-rich-text__tinymce li { + line-height: 1.5; +} + +.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 { + margin: 0 0 1.6em 1.3333em; + padding: 0; +} + +.block-library-list .editor-rich-text__tinymce { + 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 ul:not(.wp-block-gallery) li > ul, +.editor-block-list__block ul:not(.wp-block-gallery) li > ul, +.block-library-list li > ul, +.edit-post-visual-editor li > ol, +.editor-block-list__block li > ol, +.block-library-list li > ol { + margin-bottom: 0; +} + +.wp-block-freeform.block-library-rich-text__tinymce li, +.editor-block-list__block li { + margin-bottom: 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 { + margin-left: 0; + margin-right: 1.3333em; +} + +/* Code */ + +.wp-block-freeform.block-library-rich-text__tinymce code { + background: transparent; +} + + +/* Captions */ + +[class^="wp-block-"] figcaption, +[class^="wp-block-"] figcaption.editor-rich-text__tinymce.mce-content-body { + font-size: 12px; + font-style: italic; + line-height: 1.5; + margin: 9px 0 0; +} + +/* Tables */ + +.edit-post-visual-editor .editor-block-list__block table, +.edit-post-visual-editor .editor-block-list__block table th, +.edit-post-visual-editor .editor-block-list__block table td { + border: 1px solid rgba(0, 0, 0, 0.1); + font-size: 14px; + line-height: 1.2857142857; +} + +.edit-post-visual-editor .editor-block-list__block table { + border-collapse: separate; + border-spacing: 0; + border-width: 1px 0 0 1px; + margin-bottom: 24px; + width: 100%; +} + +.edit-post-visual-editor .editor-block-list__block table th { + border-width: 0 1px 1px 0; + font-weight: 700; + text-align: left; + text-transform: uppercase; +} + +.edit-post-visual-editor .editor-block-list__block table td { + border-width: 0 1px 1px 0; +} + +.rtl .edit-post-visual-editor .editor-block-list__block table th { + text-align: right; +} + +/* Quotes */ + +.wp-block-freeform.block-library-rich-text__tinymce blockquote { + border-left: 0; + border-right: 0; + padding-left: 0; + padding-right: 0; +} + +.wp-block-freeform.block-library-rich-text__tinymce blockquote p { + font-size: 19px; +} + +/* Tables */ + +.editor-block-list__block .wp-block-table th, +.editor-block-list__block .wp-block-table td { + padding: 0; +} + +/*-------------------------------------------------------------- +3.0 Blocks - Common Blocks +--------------------------------------------------------------*/ + +/* Paragraph */ + +p.has-drop-cap:not(:focus)::first-letter { + font-size: 5em; +} + +/* Image */ + +.wp-block-image { + margin-bottom: 24px; + max-width: 800px; +} + +.wp-block-image figcaption { + text-align: left; +} + +@media screen and (min-width: 810px) { + [data-type="core/image"][data-align="left"] .editor-block-list__block-edit { + clear: left; + margin-left: -198px; /* 30px wider than front-end, to account for editor tool spacing */ + } + + [data-type="core/image"][data-align="right"] .editor-block-list__block-edit { + clear: right; + margin-right: -198px; /* 30px wider than front-end, to account for editor tool spacing */ + } +} + +.rtl .wp-block-image figcaption { + text-align: right; +} + +/* Gallery */ + +.editor-block-list__block .wp-block-gallery { + margin-left: 0; + margin-right: 0; +} + +/* Quote */ + +.editor-block-list__block .wp-block-quote p { + font-size: 19px; +} + +.wp-block-quote:not(.is-large):not(.is-style-large) { + border-left: 0; + border-right: 0; + padding-left: 0; + padding-right: 0; +} + +.wp-block-quote.is-large, +.wp-block-quote.is-style-large { + padding: 0; +} + +.wp-block-quote.is-large p, +.wp-block-quote.is-style-large p { + font-size: 24px; + line-height: 1.6; +} + +.wp-block-quote .wp-block-quote__citation { + color: #2b2b2b; + font-size: 16px; + font-weight: 400; + margin-top: 0; +} + +.wp-block-quote.alignleft .wp-block-quote__citation, +.wp-block-quote.alignright .wp-block-quote__citation { + display: inline-block; + margin-bottom: 17px; +} + +@media screen and (min-width: 1200px) { + .editor-block-list__block .wp-block-quote.alignleft, + .editor-block-list__block .wp-block-quote.alignright { + width: -webkit-calc(50% + 130px); + width: calc(50% + 130px); + } + + .editor-block-list__block .wp-block-quote.alignleft { + clear: left; + margin-left: -168px; + } + + .editor-block-list__block .wp-block-quote.alignright { + clear: right; + margin-right: -168px; + } +} + +/* Cover */ + +.wp-block-cover-image.aligncenter, +.wp-block-cover.aligncenter { + display: flex; +} + +/* File */ + +.wp-block-file .wp-block-file__textlink { + color: #24890d; + text-decoration: underline; +} + +.wp-block-file .wp-block-file__button { + background-color: #24890d; + border: 0; + border-radius: 2px; + color: #fff; + font-size: 12px; + font-weight: 700; + line-height: normal; + padding: 10px 30px 11px; + text-transform: uppercase; + vertical-align: bottom; +} + +.editor-block-list__block .wp-block-file .wp-block-file__button.mce-content-body { + line-height: normal; +} + +/*-------------------------------------------------------------- +4.0 Blocks - Formatting +--------------------------------------------------------------*/ + +/* Code */ + +.wp-block-code { + border: 0; + padding: 0; +} + +/* Pullquote */ + +.wp-block-pullquote { + border: 0; + margin: 0; +} + +.wp-block-pullquote .wp-block-pullquote__citation { + color: #2b2b2b; + font-size: 16px; + font-weight: 400; + margin-top: 0; + text-transform: none; +} + +.wp-block-pullquote.alignleft blockquote > .editor-rich-text p, +.wp-block-pullquote.alignright blockquote > .editor-rich-text p { + font-size: 20px; +} + +@media screen and (min-width: 810px) { + .editor-block-list__block .wp-block-pullquote.alignleft { + margin-left: -168px; + } + + .editor-block-list__block .wp-block-pullquote.alignright { + margin-right: -168px; + } +} + +/*-------------------------------------------------------------- +5.0 Blocks - Layout Elements +--------------------------------------------------------------*/ + +/* Buttons */ + +.wp-block-button .wp-block-button__link { + background-color: #24890d; + border: 0; + border-radius: 2px; + color: #fff; + font-size: 12px; + font-weight: 700; + padding: 10px 30px 11px; + text-transform: uppercase; + vertical-align: bottom; +} + +.editor-block-list__block .wp-block-button .mce-content-body { + line-height: normal; +} + +/* 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-categories ul { + list-style-position: inside; +} + +.wp-block-archives li a, +.wp-block-categories__list li a, +.wp-block-latest-posts li a { + text-decoration: underline; +} + +/* Latest Comments */ + +.editor-block-list__block ol.wp-block-latest-comments, +.rtl .editor-block-list__block ol.wp-block-latest-comments { + margin: 0; + padding: 0; +} + +.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt, +.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta { + margin-left: 60px; +} + +.wp-block-latest-comments .avatar, .wp-block-latest-comments__comment-avatar { + border-radius: 0; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 2px; +} + +.wp-block-latest-comments__comment, +.wp-block-latest-comments__comment-excerpt, +.wp-block-latest-comments__comment-excerpt p { + font-size: 16px; +} + +.editor-block-list__block .wp-block-latest-comments__comment-meta a, +.editor-block-list__block .wp-block-latest-comments__comment-meta a:visited { + color: #2b2b2b; + font-weight: 900; + text-decoration: none; +} + +.wp-block-latest-comments__comment-date { + text-transform: uppercase; +} + +.wp-block-latest-comments .wp-block-latest-comments__comment { + border-top: 1px solid rgba(0, 0, 0, 0.1); + margin-bottom: 24px; + padding-top: 24px; +} + +/* Latest Posts */ + +.edit-post-visual-editor .editor-block-list__block .wp-block-latest-posts.is-grid { + list-style: none; + margin-left: 0; + margin-right: 0; +} diff --git a/themes/twentyfourteen/featured-content.php b/themes/twentyfourteen/featured-content.php index f9f32dd3..c56edf3e 100644 --- a/themes/twentyfourteen/featured-content.php +++ b/themes/twentyfourteen/featured-content.php @@ -19,11 +19,11 @@ do_action( 'twentyfourteen_featured_posts_before' ); $featured_posts = twentyfourteen_get_featured_posts(); - foreach ( (array) $featured_posts as $order => $post ) : - setup_postdata( $post ); + foreach ( (array) $featured_posts as $order => $post ) : + setup_postdata( $post ); - // Include the featured content template. - get_template_part( 'content', 'featured-post' ); + // Include the featured content template. + get_template_part( 'content', 'featured-post' ); endforeach; /** diff --git a/themes/twentyfourteen/footer.php b/themes/twentyfourteen/footer.php index d1016eb9..066fa385 100644 --- a/themes/twentyfourteen/footer.php +++ b/themes/twentyfourteen/footer.php @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/themes/twentyfourteen/functions.php b/themes/twentyfourteen/functions.php index 49deb790..3babfeb1 100644 --- a/themes/twentyfourteen/functions.php +++ b/themes/twentyfourteen/functions.php @@ -44,101 +44,122 @@ if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { } if ( ! function_exists( 'twentyfourteen_setup' ) ) : - /** - * Twenty Fourteen setup. - * - * Set up theme defaults and registers support for various WordPress features. - * - * Note that this function is hooked into the after_setup_theme hook, which - * runs before the init hook. The init hook is too late for some features, such - * as indicating support post thumbnails. +/** + * Twenty Fourteen setup. + * + * Set up theme defaults and registers support for various WordPress features. + * + * Note that this function is hooked into the after_setup_theme hook, which + * runs before the init hook. The init hook is too late for some features, such + * as indicating support post thumbnails. + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_setup() { + + /* + * Make Twenty Fourteen available for translation. * - * @since Twenty Fourteen 1.0 + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen + * If you're building a theme based on Twenty Fourteen, use a find and + * replace to change 'twentyfourteen' to the name of your theme in all + * template files. */ - function twentyfourteen_setup() { - - /* - * Make Twenty Fourteen available for translation. - * - * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen - * If you're building a theme based on Twenty Fourteen, use a find and - * replace to change 'twentyfourteen' to the name of your theme in all - * template files. - */ - load_theme_textdomain( 'twentyfourteen' ); - - // This theme styles the visual editor to resemble the theme style. - add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); - - // Add RSS feed links to for posts and comments. - add_theme_support( 'automatic-feed-links' ); - - // Enable support for Post Thumbnails, and declare two sizes. - add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 672, 372, true ); - add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); - - // This theme uses wp_nav_menu() in two locations. - register_nav_menus( - array( - 'primary' => __( 'Top primary menu', 'twentyfourteen' ), - 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), - ) - ); + load_theme_textdomain( 'twentyfourteen' ); - /* - * Switch default core markup for search form, comment form, and comments - * to output valid HTML5. - */ - add_theme_support( - 'html5', array( - 'search-form', - 'comment-form', - 'comment-list', - 'gallery', - 'caption', - ) - ); + // This theme styles the visual editor to resemble the theme style. + add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); - /* - * Enable support for Post Formats. - * See https://codex.wordpress.org/Post_Formats - */ - add_theme_support( - 'post-formats', array( - 'aside', - 'image', - 'video', - 'audio', - 'quote', - 'link', - 'gallery', - ) - ); + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); - // This theme allows users to set a custom background. - add_theme_support( - 'custom-background', apply_filters( - 'twentyfourteen_custom_background_args', array( - 'default-color' => 'f5f5f5', - ) - ) - ); + // Load default block styles. + add_theme_support( 'wp-block-styles' ); - // Add support for featured content. - add_theme_support( - 'featured-content', array( - 'featured_content_filter' => 'twentyfourteen_get_featured_posts', - 'max_posts' => 6, - ) - ); + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Add support for custom color scheme. + add_theme_support( 'editor-color-palette', array( + array( + 'name' => __( 'Green', 'twentyfourteen' ), + 'slug' => 'green', + 'color' => '#24890d', + ), + array( + 'name' => __( 'Black', 'twentyfourteen' ), + 'slug' => 'black', + 'color' => '#000', + ), + array( + 'name' => __( 'Dark Gray', 'twentyfourteen' ), + 'slug' => 'dark-gray', + 'color' => '#2b2b2b', + ), + array( + 'name' => __( 'Medium Gray', 'twentyfourteen' ), + 'slug' => 'medium-gray', + 'color' => '#767676', + ), + array( + 'name' => __( 'Light Gray', 'twentyfourteen' ), + 'slug' => 'light-gray', + 'color' => '#f5f5f5', + ), + array( + 'name' => __( 'White', 'twentyfourteen' ), + 'slug' => 'white', + 'color' => '#fff', + ), + ) ); + + // Add RSS feed links to for posts and comments. + add_theme_support( 'automatic-feed-links' ); + + // Enable support for Post Thumbnails, and declare two sizes. + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 672, 372, true ); + add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( array( + 'primary' => __( 'Top primary menu', 'twentyfourteen' ), + 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), + ) ); - // This theme uses its own gallery styles. - add_filter( 'use_default_gallery_style', '__return_false' ); + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( 'html5', array( + 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' + ) ); - // Indicate widget sidebars can use selective refresh in the Customizer. - add_theme_support( 'customize-selective-refresh-widgets' ); - } + /* + * Enable support for Post Formats. + * See https://codex.wordpress.org/Post_Formats + */ + add_theme_support( 'post-formats', array( + 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery', + ) ); + + // This theme allows users to set a custom background. + add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( + 'default-color' => 'f5f5f5', + ) ) ); + + // Add support for featured content. + add_theme_support( 'featured-content', array( + 'featured_content_filter' => 'twentyfourteen_get_featured_posts', + 'max_posts' => 6, + ) ); + + // This theme uses its own gallery styles. + add_filter( 'use_default_gallery_style', '__return_false' ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); +} endif; // twentyfourteen_setup add_action( 'after_setup_theme', 'twentyfourteen_setup' ); @@ -192,39 +213,33 @@ function twentyfourteen_widgets_init() { require get_template_directory() . '/inc/widgets.php'; register_widget( 'Twenty_Fourteen_Ephemera_Widget' ); - register_sidebar( - array( - 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) - ); - register_sidebar( - array( - 'name' => __( 'Content Sidebar', 'twentyfourteen' ), - 'id' => 'sidebar-2', - 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) - ); - register_sidebar( - array( - 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) - ); + register_sidebar( array( + 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); + register_sidebar( array( + 'name' => __( 'Content Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); + register_sidebar( array( + 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) ); } add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); @@ -246,7 +261,7 @@ function twentyfourteen_font_url() { 'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), 'subset' => urlencode( 'latin,latin-ext' ), ); - $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return $font_url; @@ -267,6 +282,9 @@ function twentyfourteen_scripts() { // Load our main stylesheet. wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri() ); + // Theme block stylesheet. + wp_enqueue_style( 'twentyfourteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfourteen-style' ), '20181018' ); + // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131205' ); wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' ); @@ -285,12 +303,10 @@ function twentyfourteen_scripts() { if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); - wp_localize_script( - 'twentyfourteen-slider', 'featuredSliderDefaults', array( - 'prevText' => __( 'Previous', 'twentyfourteen' ), - 'nextText' => __( 'Next', 'twentyfourteen' ), - ) - ); + wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( + 'prevText' => __( 'Previous', 'twentyfourteen' ), + 'nextText' => __( 'Next', 'twentyfourteen' ) + ) ); } wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150315', true ); @@ -332,100 +348,110 @@ function twentyfourteen_resource_hints( $urls, $relation_type ) { } add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); +/** + * Enqueue styles for the block-based editor. + * + * @since Twenty Fourteen 2.3 + */ +function twentyfourteen_block_editor_styles() { + // Block styles. + wp_enqueue_style( 'twentyfourteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' ); + // Add custom fonts. + wp_enqueue_style( 'twentyfourteen-fonts', twentyfourteen_font_url(), array(), null ); +} +add_action( 'enqueue_block_editor_assets', 'twentyfourteen_block_editor_styles' ); + if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : +/** + * Print the attached image with a link to the next attached image. + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_the_attached_image() { + $post = get_post(); /** - * Print the attached image with a link to the next attached image. + * Filter the default Twenty Fourteen attachment size. * * @since Twenty Fourteen 1.0 + * + * @param array $dimensions { + * An array of height and width dimensions. + * + * @type int $height Height of the image in pixels. Default 810. + * @type int $width Width of the image in pixels. Default 810. + * } */ - function twentyfourteen_the_attached_image() { - $post = get_post(); - /** - * Filter the default Twenty Fourteen attachment size. - * - * @since Twenty Fourteen 1.0 - * - * @param array $dimensions { - * An array of height and width dimensions. - * - * @type int $height Height of the image in pixels. Default 810. - * @type int $width Width of the image in pixels. Default 810. - * } - */ - $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); - $next_attachment_url = wp_get_attachment_url(); - - /* - * Grab the IDs of all the image attachments in a gallery so we can get the URL - * of the next adjacent image in a gallery, or the first image (if we're - * looking at the last image in a gallery), or, in a gallery of one, just the - * link to that image file. - */ - $attachment_ids = get_posts( - array( - 'post_parent' => $post->post_parent, - 'fields' => 'ids', - 'numberposts' => -1, - 'post_status' => 'inherit', - 'post_type' => 'attachment', - 'post_mime_type' => 'image', - 'order' => 'ASC', - 'orderby' => 'menu_order ID', - ) - ); + $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); + $next_attachment_url = wp_get_attachment_url(); - // If there is more than 1 attachment in a gallery... - if ( count( $attachment_ids ) > 1 ) { - foreach ( $attachment_ids as $idx => $attachment_id ) { - if ( $attachment_id == $post->ID ) { - $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; - break; - } + /* + * Grab the IDs of all the image attachments in a gallery so we can get the URL + * of the next adjacent image in a gallery, or the first image (if we're + * looking at the last image in a gallery), or, in a gallery of one, just the + * link to that image file. + */ + $attachment_ids = get_posts( array( + 'post_parent' => $post->post_parent, + 'fields' => 'ids', + 'numberposts' => -1, + 'post_status' => 'inherit', + 'post_type' => 'attachment', + 'post_mime_type' => 'image', + 'order' => 'ASC', + 'orderby' => 'menu_order ID', + ) ); + + // If there is more than 1 attachment in a gallery... + if ( count( $attachment_ids ) > 1 ) { + foreach ( $attachment_ids as $idx => $attachment_id ) { + if ( $attachment_id == $post->ID ) { + $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; + break; } + } - // get the URL of the next image attachment... - if ( $next_id ) { - $next_attachment_url = get_attachment_link( $next_id ); - } // or get the URL of the first image attachment. - else { - $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); - } + // get the URL of the next image attachment... + if ( $next_id ) { + $next_attachment_url = get_attachment_link( $next_id ); } - printf( - '%2$s', - esc_url( $next_attachment_url ), - wp_get_attachment_image( $post->ID, $attachment_size ) - ); + // or get the URL of the first image attachment. + else { + $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); + } } + + printf( '%2$s', + esc_url( $next_attachment_url ), + wp_get_attachment_image( $post->ID, $attachment_size ) + ); +} endif; if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : - /** - * Print a list of all site contributors who published at least one post. - * - * @since Twenty Fourteen 1.0 - */ - function twentyfourteen_list_authors() { - $contributor_ids = get_users( - array( - 'fields' => 'ID', - 'orderby' => 'post_count', - 'order' => 'DESC', - 'who' => 'authors', - ) - ); - - foreach ( $contributor_ids as $contributor_id ) : - $post_count = count_user_posts( $contributor_id ); - - // Move on if user has not published a post (yet). - if ( ! $post_count ) { - continue; - } - ?> +/** + * Print a list of all site contributors who published at least one post. + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_list_authors() { + $contributor_ids = get_users( array( + 'fields' => 'ID', + 'orderby' => 'post_count', + 'order' => 'DESC', + 'who' => 'authors', + ) ); + + foreach ( $contributor_ids as $contributor_id ) : + $post_count = count_user_posts( $contributor_id ); + + // Move on if user has not published a post (yet). + if ( ! $post_count ) { + continue; + } + ?> -
+
@@ -442,7 +468,7 @@ if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : is_preview(); - } + return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview(); +} endif; diff --git a/themes/twentyfourteen/header.php b/themes/twentyfourteen/header.php index 4dec164a..7286d889 100644 --- a/themes/twentyfourteen/header.php +++ b/themes/twentyfourteen/header.php @@ -51,15 +51,7 @@
diff --git a/themes/twentyfourteen/image.php b/themes/twentyfourteen/image.php index 999800fa..83ac67f6 100644 --- a/themes/twentyfourteen/image.php +++ b/themes/twentyfourteen/image.php @@ -18,48 +18,45 @@ get_header(); -
+ -
-
-
- -
+
+
+
+ +
- +
-
+
- '', 'link_before' => '', 'link_after' => '', - ) - ); - ?> + ) ); + ?>
diff --git a/themes/twentyfourteen/inc/back-compat.php b/themes/twentyfourteen/inc/back-compat.php index 3943aeef..c184d912 100644 --- a/themes/twentyfourteen/inc/back-compat.php +++ b/themes/twentyfourteen/inc/back-compat.php @@ -44,11 +44,9 @@ function twentyfourteen_upgrade_notice() { * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize() { - wp_die( - sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) - ); + wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array( + 'back_link' => true, + ) ); } add_action( 'load-customize.php', 'twentyfourteen_customize' ); diff --git a/themes/twentyfourteen/inc/custom-header.php b/themes/twentyfourteen/inc/custom-header.php index bfea8976..287b1068 100644 --- a/themes/twentyfourteen/inc/custom-header.php +++ b/themes/twentyfourteen/inc/custom-header.php @@ -35,40 +35,36 @@ function twentyfourteen_custom_header_setup() { * the Appearance > Header screen. * } */ - add_theme_support( - 'custom-header', apply_filters( - 'twentyfourteen_custom_header_args', array( - 'default-text-color' => 'fff', - 'width' => 1260, - 'height' => 240, - 'flex-height' => true, - 'wp-head-callback' => 'twentyfourteen_header_style', - 'admin-head-callback' => 'twentyfourteen_admin_header_style', - 'admin-preview-callback' => 'twentyfourteen_admin_header_image', - ) - ) - ); + add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( + 'default-text-color' => 'fff', + 'width' => 1260, + 'height' => 240, + 'flex-height' => true, + 'wp-head-callback' => 'twentyfourteen_header_style', + 'admin-head-callback' => 'twentyfourteen_admin_header_style', + 'admin-preview-callback' => 'twentyfourteen_admin_header_image', + ) ) ); } add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); if ( ! function_exists( 'twentyfourteen_header_style' ) ) : - /** - * Styles the header image and text displayed on the blog - * - * @see twentyfourteen_custom_header_setup(). - */ - function twentyfourteen_header_style() { - $text_color = get_header_textcolor(); +/** + * Styles the header image and text displayed on the blog + * + * @see twentyfourteen_custom_header_setup(). + * + */ +function twentyfourteen_header_style() { + $text_color = get_header_textcolor(); - // If no custom color for text is set, let's bail. - if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { - return; - } + // If no custom color for text is set, let's bail. + if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) + return; - // If we get this far, we have custom styles. - ?> - Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ - function twentyfourteen_admin_header_style() { - ?> +/** + * Style the header image displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_admin_header_style() { +?> - Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ - function twentyfourteen_admin_header_image() { - ?> +/** + * Create the custom header image markup displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_admin_header_image() { +?>
@@ -147,5 +143,5 @@ if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) :

get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( - 'blogname', array( - 'selector' => '.site-title a', - 'container_inclusive' => false, - 'render_callback' => 'twentyfourteen_customize_partial_blogname', - ) - ); - $wp_customize->selective_refresh->add_partial( - 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentyfourteen_customize_partial_blogdescription', - ) - ); + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogdescription', + ) ); } // Rename the label to "Site Title Color" because this only affects the site title in this theme. @@ -53,38 +49,31 @@ function twentyfourteen_customize_register( $wp_customize ) { } // Add the featured content section in case it's not already there. - $wp_customize->add_section( - 'featured_content', array( - 'title' => __( 'Featured Content', 'twentyfourteen' ), - 'description' => sprintf( - __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), - esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), - admin_url( 'edit.php?show_sticky=1' ) - ), - 'priority' => 130, - 'active_callback' => 'is_front_page', - ) - ); + $wp_customize->add_section( 'featured_content', array( + 'title' => __( 'Featured Content', 'twentyfourteen' ), + 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), + esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), + admin_url( 'edit.php?show_sticky=1' ) + ), + 'priority' => 130, + 'active_callback' => 'is_front_page', + ) ); // Add the featured content layout setting and control. - $wp_customize->add_setting( - 'featured_content_layout', array( - 'default' => 'grid', - 'sanitize_callback' => 'twentyfourteen_sanitize_layout', - ) - ); + $wp_customize->add_setting( 'featured_content_layout', array( + 'default' => 'grid', + 'sanitize_callback' => 'twentyfourteen_sanitize_layout', + ) ); - $wp_customize->add_control( - 'featured_content_layout', array( - 'label' => __( 'Layout', 'twentyfourteen' ), - 'section' => 'featured_content', - 'type' => 'select', - 'choices' => array( - 'grid' => __( 'Grid', 'twentyfourteen' ), - 'slider' => __( 'Slider', 'twentyfourteen' ), - ), - ) - ); + $wp_customize->add_control( 'featured_content_layout', array( + 'label' => __( 'Layout', 'twentyfourteen' ), + 'section' => 'featured_content', + 'type' => 'select', + 'choices' => array( + 'grid' => __( 'Grid', 'twentyfourteen' ), + 'slider' => __( 'Slider', 'twentyfourteen' ), + ), + ) ); } add_action( 'customize_register', 'twentyfourteen_customize_register' ); @@ -148,18 +137,16 @@ function twentyfourteen_contextual_help() { return; } - get_current_screen()->add_help_tab( - array( - 'id' => 'twentyfourteen', - 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), - 'content' => - '
    ' . - '
  • ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
  • ' . - '
  • ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
  • ' . - '
  • ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Twenty Fourteen documentation.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '
  • ' . - '
', - ) - ); + get_current_screen()->add_help_tab( array( + 'id' => 'twentyfourteen', + 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), + 'content' => + '
    ' . + '
  • ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
  • ' . + '
  • ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
  • ' . + '
  • ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Twenty Fourteen documentation.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '
  • ' . + '
', + ) ); } add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' ); -add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' ); +add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' ); diff --git a/themes/twentyfourteen/inc/featured-content.php b/themes/twentyfourteen/inc/featured-content.php index 808a8a74..ffeb993d 100644 --- a/themes/twentyfourteen/inc/featured-content.php +++ b/themes/twentyfourteen/inc/featured-content.php @@ -23,6 +23,8 @@ class Featured_Content { * * @since Twenty Fourteen 1.0 * + * @static + * @access public * @var int */ public static $max_posts = 15; @@ -32,6 +34,8 @@ class Featured_Content { * * All custom functionality will be hooked into the "init" action. * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function setup() { @@ -47,6 +51,8 @@ class Featured_Content { * If no theme support is found there is no need to hook into WordPress. * We'll just return early instead. * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function init() { @@ -77,15 +83,15 @@ class Featured_Content { self::$max_posts = absint( $theme_support[0]['max_posts'] ); } - add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); - add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); - add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); - add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); - add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); - add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); - add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); - add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); - add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); + add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); + add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); + add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); + add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); + add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); + add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); + add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); + add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); + add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); } /** @@ -94,11 +100,13 @@ class Featured_Content { * Has to run on wp_loaded so that the preview filters of the Customizer * have a chance to alter the value. * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function wp_loaded() { if ( self::get_setting( 'hide-tag' ) ) { - add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); + add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 ); } } @@ -106,6 +114,8 @@ class Featured_Content { /** * Get featured posts. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @return array Array of featured posts. @@ -118,12 +128,10 @@ class Featured_Content { return array(); } - $featured_posts = get_posts( - array( - 'include' => $post_ids, - 'posts_per_page' => count( $post_ids ), - ) - ); + $featured_posts = get_posts( array( + 'include' => $post_ids, + 'posts_per_page' => count( $post_ids ), + ) ); return $featured_posts; } @@ -136,6 +144,8 @@ class Featured_Content { * * Sets the "featured_content_ids" transient. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @return array Array of post IDs. @@ -150,20 +160,18 @@ class Featured_Content { if ( $term ) { // Query for featured posts. - $featured_ids = get_posts( - array( - 'fields' => 'ids', - 'numberposts' => self::$max_posts, - 'suppress_filters' => false, - 'tax_query' => array( - array( - 'field' => 'term_id', - 'taxonomy' => 'post_tag', - 'terms' => $term->term_id, - ), + $featured_ids = get_posts( array( + 'fields' => 'ids', + 'numberposts' => self::$max_posts, + 'suppress_filters' => false, + 'tax_query' => array( + array( + 'field' => 'term_id', + 'taxonomy' => 'post_tag', + 'terms' => $term->term_id, ), - ) - ); + ), + ) ); } // Get sticky posts if no Featured Content exists. @@ -181,6 +189,8 @@ class Featured_Content { /** * Return an array with IDs of posts maked as sticky. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @return array Array of sticky posts. @@ -196,6 +206,8 @@ class Featured_Content { * * @see Featured_Content::validate_settings(). * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function delete_transient() { @@ -209,6 +221,8 @@ class Featured_Content { * Hooked onto the 'pre_get_posts' action, this changes the parameters of * the query before it gets any posts. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param WP_Query $query WP_Query object. @@ -255,6 +269,8 @@ class Featured_Content { * * @see Featured_Content::validate_settings(). * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param int $tag_id The term_id of the tag that has been deleted. @@ -267,7 +283,7 @@ class Featured_Content { } $settings['tag-id'] = 0; - $settings = self::validate_settings( $settings ); + $settings = self::validate_settings( $settings ); update_option( 'featured-content', $settings ); } @@ -276,6 +292,8 @@ class Featured_Content { * * Hooks into the "get_terms" filter. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param array $terms List of term objects. This is the return value of get_terms(). @@ -322,6 +340,8 @@ class Featured_Content { * * Hooks into the "get_the_terms" filter. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param array $terms A list of term objects. This is the return value of get_the_terms(). @@ -361,6 +381,8 @@ class Featured_Content { /** * Register custom setting on the Settings -> Reading screen. * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function register_setting() { @@ -370,61 +392,54 @@ class Featured_Content { /** * Add settings to the Customizer. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param WP_Customize_Manager $wp_customize Customizer object. */ public static function customize_register( $wp_customize ) { - $wp_customize->add_section( - 'featured_content', array( - 'title' => __( 'Featured Content', 'twentyfourteen' ), - 'description' => sprintf( - __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), - esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), - admin_url( 'edit.php?show_sticky=1' ) - ), - 'priority' => 130, - 'theme_supports' => 'featured-content', - ) - ); + $wp_customize->add_section( 'featured_content', array( + 'title' => __( 'Featured Content', 'twentyfourteen' ), + 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), + esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), + admin_url( 'edit.php?show_sticky=1' ) + ), + 'priority' => 130, + 'theme_supports' => 'featured-content', + ) ); // Add Featured Content settings. - $wp_customize->add_setting( - 'featured-content[tag-name]', array( - 'default' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), - 'type' => 'option', - 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), - ) - ); - $wp_customize->add_setting( - 'featured-content[hide-tag]', array( - 'default' => true, - 'type' => 'option', - 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), - ) - ); + $wp_customize->add_setting( 'featured-content[tag-name]', array( + 'default' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), + 'type' => 'option', + 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), + ) ); + $wp_customize->add_setting( 'featured-content[hide-tag]', array( + 'default' => true, + 'type' => 'option', + 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), + ) ); // Add Featured Content controls. - $wp_customize->add_control( - 'featured-content[tag-name]', array( - 'label' => __( 'Tag Name', 'twentyfourteen' ), - 'section' => 'featured_content', - 'priority' => 20, - ) - ); - $wp_customize->add_control( - 'featured-content[hide-tag]', array( - 'label' => __( 'Don’t display tag on front end.', 'twentyfourteen' ), - 'section' => 'featured_content', - 'type' => 'checkbox', - 'priority' => 30, - ) - ); + $wp_customize->add_control( 'featured-content[tag-name]', array( + 'label' => __( 'Tag Name', 'twentyfourteen' ), + 'section' => 'featured_content', + 'priority' => 20, + ) ); + $wp_customize->add_control( 'featured-content[hide-tag]', array( + 'label' => __( 'Don’t display tag on front end.', 'twentyfourteen' ), + 'section' => 'featured_content', + 'type' => 'checkbox', + 'priority' => 30, + ) ); } /** * Enqueue the tag suggestion script. * + * @static + * @access public * @since Twenty Fourteen 1.0 */ public static function enqueue_scripts() { @@ -443,6 +458,8 @@ class Featured_Content { * its name as the first parameter to the function and only that * value will be returned. * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param string $key The key of a recognized setting. @@ -474,6 +491,8 @@ class Featured_Content { * format before saving to the database. This function will also * delete the transient set in Featured_Content::get_featured_content(). * + * @static + * @access public * @since Twenty Fourteen 1.0 * * @param array $input Array of settings input. diff --git a/themes/twentyfourteen/inc/template-tags.php b/themes/twentyfourteen/inc/template-tags.php index 89393316..1d35d0d5 100644 --- a/themes/twentyfourteen/inc/template-tags.php +++ b/themes/twentyfourteen/inc/template-tags.php @@ -8,55 +8,53 @@ */ if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) : - /** - * Display navigation to next/previous set of posts when applicable. - * - * @since Twenty Fourteen 1.0 - * - * @global WP_Query $wp_query WordPress Query object. - * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. - */ - function twentyfourteen_paging_nav() { - global $wp_query, $wp_rewrite; - - // Don't print empty markup if there's only one page. - if ( $wp_query->max_num_pages < 2 ) { - return; - } +/** + * Display navigation to next/previous set of posts when applicable. + * + * @since Twenty Fourteen 1.0 + * + * @global WP_Query $wp_query WordPress Query object. + * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. + */ +function twentyfourteen_paging_nav() { + global $wp_query, $wp_rewrite; - $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; - $pagenum_link = html_entity_decode( get_pagenum_link() ); - $query_args = array(); - $url_parts = explode( '?', $pagenum_link ); + // Don't print empty markup if there's only one page. + if ( $wp_query->max_num_pages < 2 ) { + return; + } - if ( isset( $url_parts[1] ) ) { - wp_parse_str( $url_parts[1], $query_args ); - } + $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; + $pagenum_link = html_entity_decode( get_pagenum_link() ); + $query_args = array(); + $url_parts = explode( '?', $pagenum_link ); - $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); - $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; - - $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; - $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; - - // Set up paginated links. - $links = paginate_links( - array( - 'base' => $pagenum_link, - 'format' => $format, - 'total' => $wp_query->max_num_pages, - 'current' => $paged, - 'mid_size' => 1, - 'add_args' => array_map( 'urlencode', $query_args ), - 'prev_text' => __( '← Previous', 'twentyfourteen' ), - 'next_text' => __( 'Next →', 'twentyfourteen' ), - ) - ); + if ( isset( $url_parts[1] ) ) { + wp_parse_str( $url_parts[1], $query_args ); + } + + $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); + $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; + + $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; + $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; - if ( $links ) : + // Set up paginated links. + $links = paginate_links( array( + 'base' => $pagenum_link, + 'format' => $format, + 'total' => $wp_query->max_num_pages, + 'current' => $paged, + 'mid_size' => 1, + 'add_args' => array_map( 'urlencode', $query_args ), + 'prev_text' => __( '← Previous', 'twentyfourteen' ), + 'next_text' => __( 'Next →', 'twentyfourteen' ), + ) ); - ?> -
+ + ' . __( 'Sticky', 'twentyfourteen' ) . ''; - } - - // Set up and print post meta information. - printf( - ' ', - esc_url( get_permalink() ), - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); +/** + * Print HTML with meta information for the current post-date/time and author. + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_posted_on() { + if ( is_sticky() && is_home() && ! is_paged() ) { + echo '' . __( 'Sticky', 'twentyfourteen' ) . ''; } + + // Set up and print post meta information. + printf( ' ', + esc_url( get_permalink() ), + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); +} endif; /** @@ -133,11 +130,9 @@ endif; function twentyfourteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { // Create an array of all the categories that are attached to posts - $all_the_cool_cats = get_categories( - array( - 'hide_empty' => 1, - ) - ); + $all_the_cool_cats = get_categories( array( + 'hide_empty' => 1, + ) ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); @@ -164,71 +159,69 @@ function twentyfourteen_category_transient_flusher() { delete_transient( 'twentyfourteen_category_count' ); } add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); -add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); +add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) : - /** - * Display an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index - * views, or a div element when on single views. - * - * @since Twenty Fourteen 1.0 - * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. - */ - function twentyfourteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } +/** + * Display an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index + * views, or a div element when on single views. + * + * @since Twenty Fourteen 1.0 + * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. + */ +function twentyfourteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> -
- + -
+ ?> +
- + - %2$s', - esc_url( get_permalink( get_the_ID() ) ), +/** + * Replaces "[...]" (appended to automatically generated excerpts) with ... + * and a Continue reading link. + * + * @since Twenty Fourteen 1.3 + * + * @param string $more Default Read More excerpt link. + * @return string Filtered Read More excerpt link. + */ +function twentyfourteen_excerpt_more( $more ) { + $link = sprintf( '%2$s', + esc_url( get_permalink( get_the_ID() ) ), /* translators: %s: Name of current post */ sprintf( __( 'Continue reading %s ', 'twentyfourteen' ), '' . get_the_title( get_the_ID() ) . '' ) ); - return ' … ' . $link; - } - add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); + return ' … ' . $link; +} +add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); endif; diff --git a/themes/twentyfourteen/inc/widgets.php b/themes/twentyfourteen/inc/widgets.php index 64118b5e..533f34a5 100644 --- a/themes/twentyfourteen/inc/widgets.php +++ b/themes/twentyfourteen/inc/widgets.php @@ -16,6 +16,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * The supported post formats. * + * @access private * @since Twenty Fourteen 1.0 * * @var array @@ -30,13 +31,11 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * @return Twenty_Fourteen_Ephemera_Widget */ public function __construct() { - parent::__construct( - 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( - 'classname' => 'widget_twentyfourteen_ephemera', - 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), - 'customize_selective_refresh' => true, - ) - ); + parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( + 'classname' => 'widget_twentyfourteen_ephemera', + 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), + 'customize_selective_refresh' => true, + ) ); if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); @@ -63,6 +62,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * Output the HTML for this widget. * + * @access public * @since Twenty Fourteen 1.0 * * @param array $args An array of standard parameters for widgets in this theme. @@ -106,26 +106,24 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); - $ephemera = new WP_Query( - array( - 'order' => 'DESC', - 'posts_per_page' => $number, - 'no_found_rows' => true, - 'post_status' => 'publish', - 'post__not_in' => get_option( 'sticky_posts' ), - 'tax_query' => array( - array( - 'taxonomy' => 'post_format', - 'terms' => array( "post-format-$format" ), - 'field' => 'slug', - 'operator' => 'IN', - ), + $ephemera = new WP_Query( array( + 'order' => 'DESC', + 'posts_per_page' => $number, + 'no_found_rows' => true, + 'post_status' => 'publish', + 'post__not_in' => get_option( 'sticky_posts' ), + 'tax_query' => array( + array( + 'taxonomy' => 'post_format', + 'terms' => array( "post-format-$format" ), + 'field' => 'slug', + 'operator' => 'IN', ), - ) - ); + ), + ) ); if ( $ephemera->have_posts() ) : - $tmp_content_width = $GLOBALS['content_width']; + $tmp_content_width = $GLOBALS['content_width']; $GLOBALS['content_width'] = 306; echo $args['before_widget']; @@ -136,65 +134,61 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
    have_posts() ) : - $ephemera->the_post(); - $tmp_more = $GLOBALS['more']; - $GLOBALS['more'] = 0; + while ( $ephemera->have_posts() ) : + $ephemera->the_post(); + $tmp_more = $GLOBALS['more']; + $GLOBALS['more'] = 0; ?>
  1. > -
    - →', 'twentyfourteen' ) ); - else : - $images = array(); - - $galleries = get_post_galleries( get_the_ID(), false ); - if ( isset( $galleries[0]['ids'] ) ) { - $images = explode( ',', $galleries[0]['ids'] ); - } - - if ( ! $images ) : - $images = get_posts( - array( - 'fields' => 'ids', - 'numberposts' => -1, - 'order' => 'ASC', - 'orderby' => 'menu_order', +
    + →', 'twentyfourteen' ) ); + else : + $images = array(); + + $galleries = get_post_galleries( get_the_ID(), false ); + if ( isset( $galleries[0]['ids'] ) ) + $images = explode( ',', $galleries[0]['ids'] ); + + if ( ! $images ) : + $images = get_posts( array( + 'fields' => 'ids', + 'numberposts' => -1, + 'order' => 'ASC', + 'orderby' => 'menu_order', 'post_mime_type' => 'image', - 'post_parent' => get_the_ID(), - 'post_type' => 'attachment', - ) - ); - endif; + 'post_parent' => get_the_ID(), + 'post_type' => 'attachment', + ) ); + endif; - $total_images = count( $images ); + $total_images = count( $images ); - if ( has_post_thumbnail() ) : - $post_thumbnail = get_the_post_thumbnail(); + if ( has_post_thumbnail() ) : + $post_thumbnail = get_the_post_thumbnail(); elseif ( $total_images > 0 ) : $image = reset( $images ); $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); endif; - if ( ! empty( $post_thumbnail ) ) : + if ( ! empty ( $post_thumbnail ) ) : ?>

    - %2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyfourteen' ), - esc_url( get_permalink() ), - number_format_i18n( $total_images ) - ); - ?> + %2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyfourteen' ), + esc_url( get_permalink() ), + number_format_i18n( $total_images ) + ); + ?>

    →', 'twentyfourteen' ) ); @@ -204,21 +198,20 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
    ' ); +

    ', '

    ' ); - // Output the authors list. - twentyfourteen_list_authors(); + // Output the authors list. + twentyfourteen_list_authors(); - edit_post_link( __( 'Edit', 'twentyfourteen' ), '
    ', '
    ' ); - ?> + edit_post_link( __( 'Edit', 'twentyfourteen' ), '
    ', '
    ' ); + ?>
diff --git a/themes/twentyfourteen/page-templates/full-width.php b/themes/twentyfourteen/page-templates/full-width.php index ea5fa588..8830c870 100644 --- a/themes/twentyfourteen/page-templates/full-width.php +++ b/themes/twentyfourteen/page-templates/full-width.php @@ -12,26 +12,25 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/page.php b/themes/twentyfourteen/page.php index bd033aeb..44724e94 100644 --- a/themes/twentyfourteen/page.php +++ b/themes/twentyfourteen/page.php @@ -16,26 +16,25 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/readme.txt b/themes/twentyfourteen/readme.txt index 96b7a3a3..69d4e653 100644 --- a/themes/twentyfourteen/readme.txt +++ b/themes/twentyfourteen/readme.txt @@ -1,8 +1,8 @@ === Twenty Fourteen === Contributors: the WordPress team Requires at least: WordPress 3.6 -Tested up to: WordPress 5.0-trunk -Stable tag: 2.2 +Tested up to: WordPress 5.0 +Stable tag: 2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready @@ -50,6 +50,16 @@ Source: http://www.genericons.com == Changelog == += 2.4 = +* Released: December 19, 2018 + +https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.4 + += 2.3 = +* Released: December 6, 2018 + +https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.3 + = 2.2 = * Released: May 17, 2018 diff --git a/themes/twentyfourteen/search.php b/themes/twentyfourteen/search.php index 6945c40a..d90d88a1 100644 --- a/themes/twentyfourteen/search.php +++ b/themes/twentyfourteen/search.php @@ -20,15 +20,14 @@ get_header(); ?>

diff --git a/themes/twentyfourteen/single.php b/themes/twentyfourteen/single.php index 1940c732..e089165e 100644 --- a/themes/twentyfourteen/single.php +++ b/themes/twentyfourteen/single.php @@ -13,23 +13,22 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/style.css b/themes/twentyfourteen/style.css index 46a86b4c..162d2375 100644 --- a/themes/twentyfourteen/style.css +++ b/themes/twentyfourteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfourteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier. -Version: 2.2 +Version: 2.4 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready diff --git a/themes/twentyfourteen/tag.php b/themes/twentyfourteen/tag.php index 663fe5e9..5930d2cf 100644 --- a/themes/twentyfourteen/tag.php +++ b/themes/twentyfourteen/tag.php @@ -24,23 +24,22 @@ get_header(); ?> %s
', $term_description ); + if ( ! empty( $term_description ) ) : + printf( '
%s
', $term_description ); endif; ?>