From 4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e Mon Sep 17 00:00:00 2001 From: Yury German Date: Sun, 28 Apr 2019 18:30:29 -0400 Subject: Updating the themes Updated themes. The followng themes updated: Mantra - 3.0.5 => 3.1.0, Twenty Fifteen 2.2 => 2.4 Twenty Fourteen 2.4 => 2.6, Twenty Sixteen 1.7 => 1.9 Signed-off-by: Yury German --- themes/mantra/admin/js/admin.js | 8 +- themes/mantra/admin/settings.php | 2 +- themes/mantra/functions.php | 2 +- themes/mantra/includes/custom-styles.php | 10 +- themes/mantra/includes/theme-frontpage.php | 4 +- themes/mantra/includes/theme-functions.php | 3 +- themes/mantra/includes/theme-setup.php | 3 +- themes/mantra/readme.txt | 26 +- themes/mantra/resources/css/rtl.css | 1 + themes/mantra/style.css | 335 +++++++------ themes/twentyfifteen/archive.php | 21 +- themes/twentyfifteen/comments.php | 52 +- themes/twentyfifteen/content-link.php | 40 +- themes/twentyfifteen/content-none.php | 2 +- themes/twentyfifteen/content-page.php | 20 +- themes/twentyfifteen/content-search.php | 2 +- themes/twentyfifteen/content.php | 40 +- themes/twentyfifteen/css/blocks.css | 18 +- themes/twentyfifteen/css/editor-blocks.css | 13 +- themes/twentyfifteen/functions.php | 531 ++++++++++---------- themes/twentyfifteen/header.php | 16 +- themes/twentyfifteen/image.php | 77 +-- themes/twentyfifteen/inc/back-compat.php | 10 +- themes/twentyfifteen/inc/custom-header.php | 84 ++-- themes/twentyfifteen/inc/customizer.php | 370 +++++++------- themes/twentyfifteen/inc/template-tags.php | 321 +++++++------ themes/twentyfifteen/index.php | 21 +- themes/twentyfifteen/js/functions.js | 3 +- themes/twentyfifteen/page.php | 5 +- themes/twentyfifteen/readme.txt | 12 +- themes/twentyfifteen/search.php | 22 +- themes/twentyfifteen/sidebar.php | 26 +- themes/twentyfifteen/single.php | 25 +- themes/twentyfifteen/style.css | 2 +- themes/twentyfourteen/archive.php | 27 +- themes/twentyfourteen/author.php | 21 +- themes/twentyfourteen/category.php | 21 +- themes/twentyfourteen/comments.php | 52 +- themes/twentyfourteen/content-aside.php | 36 +- themes/twentyfourteen/content-audio.php | 36 +- themes/twentyfourteen/content-featured-post.php | 14 +- themes/twentyfourteen/content-gallery.php | 36 +- themes/twentyfourteen/content-image.php | 36 +- themes/twentyfourteen/content-link.php | 36 +- themes/twentyfourteen/content-none.php | 4 +- themes/twentyfourteen/content-page.php | 16 +- themes/twentyfourteen/content-quote.php | 36 +- themes/twentyfourteen/content-video.php | 36 +- themes/twentyfourteen/content.php | 43 +- themes/twentyfourteen/css/blocks.css | 12 +- themes/twentyfourteen/css/editor-blocks.css | 13 +- themes/twentyfourteen/css/editor-style.css | 3 +- themes/twentyfourteen/featured-content.php | 8 +- themes/twentyfourteen/footer.php | 2 +- themes/twentyfourteen/functions.php | 489 ++++++++++--------- themes/twentyfourteen/header.php | 12 +- themes/twentyfourteen/image.php | 51 +- themes/twentyfourteen/inc/back-compat.php | 10 +- themes/twentyfourteen/inc/custom-header.php | 110 +++-- themes/twentyfourteen/inc/customizer.php | 110 +++-- themes/twentyfourteen/inc/featured-content.php | 166 +++---- themes/twentyfourteen/inc/template-tags.php | 285 +++++------ themes/twentyfourteen/inc/widgets.php | 155 +++--- themes/twentyfourteen/index.php | 37 +- 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 | 12 +- themes/twentyfourteen/search.php | 17 +- themes/twentyfourteen/sidebar.php | 4 +- themes/twentyfourteen/single.php | 27 +- themes/twentyfourteen/style.css | 5 +- themes/twentyfourteen/tag.php | 25 +- themes/twentyfourteen/taxonomy-post_format.php | 27 +- themes/twentysixteen/archive.php | 21 +- themes/twentysixteen/comments.php | 64 +-- themes/twentysixteen/css/blocks.css | 19 +- themes/twentysixteen/css/editor-blocks.css | 15 +- themes/twentysixteen/footer.php | 26 +- themes/twentysixteen/functions.php | 532 +++++++++++---------- themes/twentysixteen/header.php | 34 +- themes/twentysixteen/image.php | 122 ++--- themes/twentysixteen/inc/back-compat.php | 10 +- themes/twentysixteen/inc/customizer.php | 476 ++++++++++-------- themes/twentysixteen/inc/template-tags.php | 344 ++++++------- themes/twentysixteen/index.php | 21 +- themes/twentysixteen/page.php | 3 +- themes/twentysixteen/readme.txt | 12 +- themes/twentysixteen/search.php | 21 +- themes/twentysixteen/sidebar.php | 2 +- themes/twentysixteen/single.php | 29 +- themes/twentysixteen/style.css | 2 +- .../twentysixteen/template-parts/content-page.php | 20 +- .../template-parts/content-single.php | 22 +- themes/twentysixteen/template-parts/content.php | 32 +- 96 files changed, 3336 insertions(+), 2728 deletions(-) diff --git a/themes/mantra/admin/js/admin.js b/themes/mantra/admin/js/admin.js index d026e51f..462394f0 100644 --- a/themes/mantra/admin/js/admin.js +++ b/themes/mantra/admin/js/admin.js @@ -41,7 +41,7 @@ jQuery(document).ready(function() { }); // Jquery confim window on reset to defaults - jQuery('#mantra_defaults').click (function() { + jQuery('#mantra_defaults').click( function() { if (!confirm('Reset Mantra Settings to Defaults?')) { return false; } }); @@ -130,12 +130,12 @@ jQuery(document).ready(function() { $sliderNr=jQuery('#mantra_slideType').val(); //Show category if a category type is selected if ($sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" ) - jQuery('#slider-category').show(); - else jQuery('#slider-category').hide(); + jQuery('#slider-category').show(); + else jQuery('#slider-category').hide(); //Show number of slides if that's the case if ($sliderNr=="Latest Posts" || $sliderNr =="Random Posts" || $sliderNr =="Sticky Posts" || $sliderNr=="Latest Posts from Category" || $sliderNr=="Random Posts from Category" ) jQuery('#slider-post-number').show(); - else jQuery('#slider-post-number').hide(); + else jQuery('#slider-post-number').hide(); });//onchange funciton diff --git a/themes/mantra/admin/settings.php b/themes/mantra/admin/settings.php index 553b2d6f..81875345 100644 --- a/themes/mantra/admin/settings.php +++ b/themes/mantra/admin/settings.php @@ -258,7 +258,7 @@ function doAjaxRequest(){ jQuery('#post-dropdown').html(data); }, error: function(errorThrown){ - alert('Error':errorThrown); + alert( {'Error':errorThrown} ); console.log(errorThrown); } }); diff --git a/themes/mantra/functions.php b/themes/mantra/functions.php index 903c40e7..ff875ae0 100644 --- a/themes/mantra/functions.php +++ b/themes/mantra/functions.php @@ -9,7 +9,7 @@ // theme specifics define ('_CRYOUT_THEME_NAME','mantra'); -define ('_CRYOUT_THEME_VERSION','3.0.5'); +define ('_CRYOUT_THEME_VERSION','3.1.0'); require_once(get_template_directory() . "/admin/main.php"); // Load necessary admin files diff --git a/themes/mantra/includes/custom-styles.php b/themes/mantra/includes/custom-styles.php index 153ef422..9ec4b91b 100644 --- a/themes/mantra/includes/custom-styles.php +++ b/themes/mantra/includes/custom-styles.php @@ -176,7 +176,7 @@ function mantra_custom_styles() { if ($mantra_footercolor != "171717") { ?> #footer2 { background-color:; } #site-title span a { color:; } #site-description { color:; } #content, #content p, #content ul, #content ol { color: ;} #content { color: ;} .widget-area a:link, .widget-area a:visited, a:link, a:visited ,#searchform #s:hover, #container #s:hover, #access a:hover, #wp-calendar tbody td a, #site-info a, #site-copyright a, #access li:hover > a, #access ul ul:hover > a { color:; } .widget-title { background-color:; } .widget-title { color:; } #content article.post{ float:left; width:47%; margin-right:3%; } - #content article.sticky { margin-right:3%;padding:0; } + if ($mantra_magazinelayout == "Enable") { ?> #content article.post{ float:left; width:48%; margin-right:4%; } + #content article.sticky { padding: 0; } #content article.sticky > * {margin:2%;} - #content article:nth-of-type(2n+1) {clear: both; } + #content article:nth-of-type(2n) {clear: right; margin-right: 0;} #footer-widget-area .widget-title { color:; } #footer-widget-area a { color:; } @@ -215,7 +215,7 @@ function mantra_custom_styles() { if ($mantra_postcateg == "Hide") { ?> .entry-meta span.bl_categ, .entry-meta2 span.bl_categ { display:none; } .entry-utility span.bl_posted, .entry-meta2 span.bl_tagg,.entry-meta3 span.bl_tagg { display:none; } .entry-utility span.bl_bookmark { display:none; } #content p:not(:last-child), .entry-content ul, .entry-summary ul, + if ($mantra_parmargin) { ?> .entry-content p:not(:last-child), .entry-content ul, .entry-summary ul, .entry-content ol, .entry-summary ol { margin-bottom:;} p {text-indent: ; } .entry-meta .entry-time { display:none; }
diff --git a/themes/mantra/includes/theme-functions.php b/themes/mantra/includes/theme-functions.php index 5658a254..dfadb1cd 100644 --- a/themes/mantra/includes/theme-functions.php +++ b/themes/mantra/includes/theme-functions.php @@ -33,6 +33,7 @@ add_action( 'wp_head', 'mantra_header_scripts', 100 ); */ function mantra_title_and_description() { global $mantra_options; + global $mantra_totalSize; extract( $mantra_options ); // Header styling and image loading @@ -41,7 +42,7 @@ function mantra_title_and_description() { global $post; if (get_header_image() != '') { $header_image = get_header_image(); } - if ( is_singular() && has_post_thumbnail( $post->ID ) && ($mantra_fheader == "Enable") && ($image = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'header' ) ) && (intval($image[1]) >= HEADER_IMAGE_WIDTH) ): + if ( is_singular() && has_post_thumbnail( $post->ID ) && ($mantra_fheader == "Enable") && ($image = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ), 'header' ) ) && (intval($image[1]) >= $mantra_totalSize) ): $header_image = $image[0]; endif; diff --git a/themes/mantra/includes/theme-setup.php b/themes/mantra/includes/theme-setup.php index cc23596d..216c6740 100644 --- a/themes/mantra/includes/theme-setup.php +++ b/themes/mantra/includes/theme-setup.php @@ -86,8 +86,7 @@ function mantra_setup() { add_theme_support( 'custom-background' ); // Register image size for the theme's header area - $mantra_hheight = intval( $mantra_hheight ); - add_image_size( 'header', apply_filters( 'mantra_header_image_width', $mantra_totalSize ), apply_filters( 'mantra_header_image_height', $mantra_hheight), true ); + add_image_size( 'header', apply_filters( 'mantra_header_image_width', $mantra_totalSize ), apply_filters( 'mantra_header_image_height', intval($mantra_hheight) ), apply_filters( 'mantra_header_image_crop', true ) ); // Register image size for presentation page slider add_image_size( 'slider', apply_filters( 'mantra_slider_image_width', $mantra_fpsliderwidth ), apply_filters( 'mantra_slider_image_height', $mantra_fpsliderheight ), true ); diff --git a/themes/mantra/readme.txt b/themes/mantra/readme.txt index 504ae8f3..563bab36 100644 --- a/themes/mantra/readme.txt +++ b/themes/mantra/readme.txt @@ -1,11 +1,11 @@ ============= Mantra WordPress Theme -Copyright 2011-18 Cryout Creations +Copyright 2011-19 Cryout Creations Author: Cryout Creations Requires at least: 4.2 -Tested up to: 4.9.6 -Stable tag: 3.0.5 +Tested up to: 5.0.3 +Stable tag: 3.1.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html Donate link: https://www.cryoutcreations.eu/donate/ @@ -71,7 +71,7 @@ https://www.pexels.com/photo/attractive-bar-barista-breakfast-296888/ All other images bundled with the theme (used in the demo presentation page and admin section) are created by Cryout Creations and released with the theme under GPLv3 as well. -== Original Translations == +== Original Translations Contributors == Chinese (Simplified) - L�n Xuan Li Czech - Satapouch @@ -95,11 +95,27 @@ Turkish - Emre Dalkili� == Changelog == += 3.1.0 = +* Added 'mantra_header_image_crop' filter for 'header' image size crop position attribute +* Added HTML markup auto-correction on presentation page extra text areas +* Adjusted general lists bullet styling to improve compatibility with plugins and Gutenberg +* Fixed widgets containing custom HTML sometimes overlapping in the sidebars +* Fixed posts on the presentation page having extra margin when magazine layout was used +* Fixed use of undefined constant sometimes making featured images unusable in the header +* Gutenberg editor tweaks and improvements: + * Added suport for wide image blocks in content + * Adjusted aligned elements styling to improve compatibility with Gutenberg + * Improved list appearance in blocks + * Improved horizontal ruler (hr) styling to work with Gutenberg + * Fixed captions alignment and sizing in Gutenberg blocks + * Fixed block galleries margins + * Fixed cover image blocks text appearance + = 3.0.5 = * Added option to control editor styling activation after reintroducing basic editor styling * Improved slider captions by making slide links clickable through the captions * Improved slider administration interface by hiding unused fields when slider shortcode is used -* Changed default excerpt ellipis value to avoid settings page issues on some servers +* Changed default excerpt ellipsis value to avoid settings page issues on some servers * Fixed magazine layout two columns responsiveness * Fixed usage of obsolete constant in generated styling diff --git a/themes/mantra/resources/css/rtl.css b/themes/mantra/resources/css/rtl.css index 83f7bd6d..a5c212b8 100644 --- a/themes/mantra/resources/css/rtl.css +++ b/themes/mantra/resources/css/rtl.css @@ -61,6 +61,7 @@ body { .entry-content ul > li { padding-left: 0; padding-right: 20px; + background-position-x: right; } .entry-content li li { diff --git a/themes/mantra/style.css b/themes/mantra/style.css index ad14b4e8..7f9f1905 100644 --- a/themes/mantra/style.css +++ b/themes/mantra/style.css @@ -4,13 +4,13 @@ Theme URI: https://www.cryoutcreations.eu/wordpress-themes/mantra Description: Mantra is a do-it-yourself WordPress theme, featuring a pack of over 100 customization options and easy to use tweaks capable of tuning WordPress to your very specific needs and likes. With the help of a simple and efficient user interface you can customize everything:the layout (1,2 or 3 columns), total and partial site widths, colors (all texts, links, backgrounds etc.), fonts (over 35 font-families plus all Google Fonts), text and header sizes, post metas, post excerpts, post formats, header and background images, custom menus, 27 social media links and icons, pins, bullets and much much more. With a fully responsive layout,a customizable showcase presentation page, animated slider, magazine and blog layouts, 8 widget areas, modern graphics and an easy and intuitive admin section, you can start creating your dream site right now. Author: Cryout Creations Author URI: https://www.cryoutcreations.eu -Version: 3.0.5 +Version: 3.1.0 License: GNU General Public License v2.0 License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: one-column, two-columns, three-columns, right-sidebar, left-sidebar, footer-widgets, grid-layout, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, front-page-post-form, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, blog, entertainment, news Text domain: mantra -Copyright (c) 2011-2018 Cryout Creations +Copyright (c) 2011-2019 Cryout Creations https://www.cryoutcreations.eu */ @@ -136,22 +136,22 @@ a img { } /* Post info */ -.crycon-author:before { content: '\e801'; } /* '?' */ -.crycon-category:before { content: '\e805'; } /* '?' */ -.crycon-category2:before { content: '\e817'; } /* '?' */ -.crycon-folder-close:before { content: '\e81c'; } /* '?' */ -.crycon-folder-open:before { content: '\e81d'; } /* '?' */ -.crycon-tag:before { content: '\e802'; } /* '?' */ -.crycon-bookmark:before { content: '\e810'; } /* '?' */ -.crycon-edit:before { content: '\e804'; } /* '?' */ -.crycon-comment:before { content: '\e800'; } /* '?' */ -.crycon-comments:before { content: '\e815';} /* '?' */ -.crycon-date:before { content: '\e82b'; } /* '?' */ -.crycon-time:before { content: '\e80d'; } /* '?' */ +.crycon-author:before { content: '\e801'; } +.crycon-category:before { content: '\e805'; } +.crycon-category2:before { content: '\e817'; } +.crycon-folder-close:before { content: '\e81c'; } +.crycon-folder-open:before { content: '\e81d'; } +.crycon-tag:before { content: '\e802'; } +.crycon-bookmark:before { content: '\e810'; } +.crycon-edit:before { content: '\e804'; } +.crycon-comment:before { content: '\e800'; } +.crycon-comments:before { content: '\e815';} +.crycon-date:before { content: '\e82b'; } +.crycon-time:before { content: '\e80d'; } .crycon-forward:before { content: '\e81b';-webkit-transform:rotate(180deg) scale(-1, 1);-ms-transform:rotate(180deg) scale(-1, 1);transform:rotate(180deg) scale(-1, 1);margin-left:5px;font-size:10px; --moz-transition:.2s margin ease; -o-transition:.2s margin ease; -webkit-transition:.2s margin ease; transition:.2s margin ease; } /* '?' */ +-moz-transition:.2s margin ease; -o-transition:.2s margin ease; -webkit-transition:.2s margin ease; transition:.2s margin ease; } .crycon-reply:before { content: '\e81b';transform:rotate(180deg);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);margin-right:5px;font-size:10px; --moz-transition:.2s margin ease; -o-transition:.2s margin ease; -webkit-transition:.2s margin ease; transition:.2s margin ease; } /* '?' */ +-moz-transition:.2s margin ease; -o-transition:.2s margin ease; -webkit-transition:.2s margin ease; transition:.2s margin ease; } /* Post metas */ .crycon-metas:before { @@ -162,100 +162,152 @@ a img { color: #555; } -.crycon-time:before,.crycon-folder-close:before, .crycon-folder-open:before {font-size:14px; } /* '?' */ -.crycon-time:before {margin-top:1px; } /* '?' */ -.crycon-edit:before {margin-right:1px; } /* '?' */ +.crycon-time:before,.crycon-folder-close:before, .crycon-folder-open:before {font-size:14px; } +.crycon-time:before {margin-top:1px; } +.crycon-edit:before {margin-right:1px; } /* Post formats */ -.crycon-status:before { content: '\e81a'; } /* '?' */ -.crycon-aside:before { content: '\e82a'; } /* '?' */ -.crycon-link:before { content: '\e818'; } /* '?' */ -.crycon-audio:before { content: '\e823'; } /* '?' */ -.crycon-video:before { content: '\e829'; } /* '?' */ -.crycon-image:before { content: '\e824'; } /* '?' */ -.crycon-gallery:before { content: '\e825'; } /* '?' */ -.crycon-quote:before { content: '\e80f'; } /* '?' */ +.crycon-status:before { content: '\e81a'; } +.crycon-aside:before { content: '\e82a'; } +.crycon-link:before { content: '\e818'; } +.crycon-audio:before { content: '\e823'; } +.crycon-video:before { content: '\e829'; } +.crycon-image:before { content: '\e824'; } +.crycon-gallery:before { content: '\e825'; } +.crycon-quote:before { content: '\e80f'; } /* Misc */ -.crycon-search:before { content: '\e816'; } /* '?' */ -.crycon-down-dir:before { content: '\e803'; } /* '?' */ -.crycon-right-dir:before { content: '\e806'; } /* '?' */ -.crycon-angle-left:before { content: '\e807'; } /* '?' */ -.crycon-angle-right:before { content: '\e808'; } /* '?' */ -.crycon-angle-up:before { content: '\e809'; } /* '?' */ -.crycon-angle-down:before { content: '\e80a'; } /* '?' */ -.crycon-minus:before { content: '\e80b'; } /* '?' */ -.crycon-left-open:before { content: '\e80c'; } /* '?' */ -.crycon-up:before { content: '\e80e'; } /* '?' */ -.crycon-left-dir:before { content: '\e811'; } /* '?' */ -.crycon-up-open:before { content: '\e812'; } /* '?' */ -.crycon-ok:before { content: '\e813'; } /* '?' */ -.crycon-cancel:before { content: '\e814'; } /* '?' */ -.crycon-up-dir:before { content: '\e819'; } /* '?' */ -.crycon-right-open:before { content: '\e81e'; } /* '?' */ -.crycon-home:before { content: '\e81f'; } /* '?' */ -.crycon-menu:before { content: '\e820'; } /* '?' */ -.crycon-plus:before { content: '\e821'; } /* '?' */ -.crycon-down-open:before { content: '\e822'; } /* '?' */ -.crycon-down:before { content: '\e826'; } /* '?' */ -.crycon-left:before { content: '\e827'; } /* '?' */ -.crycon-right:before { content: '\e828'; } /* '?' */ -.crycon-star-empty:before { content: '\e82c'; } /* '?' */ -.crycon-star:before { content: '\e82d'; } /* '?' */ -.crycon-mail:before { content: '\e82e'; } /* '?' */ -.crycon-home-1:before { content: '\e82f'; } /* '?' */ -.crycon-attach:before { content: '\e830'; } /* '?' */ -.crycon-eye:before { content: '\e831'; } /* '?' */ -.crycon-eye-off:before { content: '\e832'; } /* '?' */ -.crycon-tags:before { content: '\e833'; } /* '?' */ -.crycon-flag:before { content: '\e834'; } /* '?' */ -.crycon-warning:before { content: '\e835'; } /* '?' */ -.crycon-location:before { content: '\e836'; } /* '?' */ -.crycon-trash:before { content: '\e837'; } /* '?' */ -.crycon-doc:before { content: '\e838'; } /* '?' */ -.crycon-phone:before { content: '\e839'; } /* '?' */ -.crycon-cog:before { content: '\e83a'; } /* '?' */ -.crycon-basket:before { content: '\e83b'; } /* '?' */ -.crycon-basket-circled:before { content: '\e83c'; } /* '?' */ -.crycon-wrench:before { content: '\e83d'; } /* '?' */ -.crycon-wrench-circled:before { content: '\e83e'; } /* '?' */ -.crycon-mic:before { content: '\e83f'; } /* '?' */ -.crycon-volume:before { content: '\e840'; } /* '?' */ -.crycon-volume-down:before { content: '\e841'; } /* '?' */ -.crycon-volume-off:before { content: '\e842'; } /* '?' */ -.crycon-headphones:before { content: '\e843'; } /* '?' */ -.crycon-lightbulb:before { content: '\e844'; } /* '?' */ -.crycon-resize-full:before { content: '\e845'; } /* '?' */ -.crycon-resize-full-alt:before { content: '\e846'; } /* '?' */ -.crycon-resize-small:before { content: '\e847'; } /* '?' */ -.crycon-resize-vertical:before { content: '\e848'; } /* '?' */ -.crycon-resize-horizontal:before { content: '\e849'; } /* '?' */ -.crycon-move:before { content: '\e84a'; } /* '?' */ -.crycon-zoom-in:before { content: '\e84b'; } /* '?' */ -.crycon-zoom-out:before { content: '\e84c'; } /* '?' */ -.crycon-arrows-cw:before { content: '\e84d'; } /* '?' */ -.crycon-desktop:before { content: '\e84e'; } /* '?' */ -.crycon-inbox:before { content: '\e84f'; } /* '?' */ -.crycon-cloud:before { content: '\e850'; } /* '?' */ -.crycon-book:before { content: '\e851'; } /* '?' */ -.crycon-certificate:before { content: '\e852'; } /* '?' */ -.crycon-tasks:before { content: '\e853'; } /* '?' */ -.crycon-thumbs-up:before { content: '\e854'; } /* '?' */ -.crycon-thumbs-down:before { content: '\e855'; } /* '?' */ -.crycon-help-circled:before { content: '\e856'; } /* '?' */ -.crycon-star-circled:before { content: '\e857'; } /* '?' */ -.crycon-bell:before { content: '\e858'; } /* '?' */ -.crycon-rss:before { content: '\e859'; } /* '?' */ -.crycon-trash-circled:before { content: '\e85a'; } /* '?' */ -.crycon-cogs:before { content: '\e85b'; } /* '?' */ -.crycon-cog-circled:before { content: '\e85c'; } /* '?' */ -.crycon-calendar-circled:before { content: '\e85d'; } /* '?' */ -.crycon-mic-circled:before { content: '\e85e'; } /* '?' */ -.crycon-volume-up:before { content: '\e85f'; } /* '?' */ -.crycon-print:before { content: '\e860'; } /* '?' */ -.crycon-edit-alt:before { content: '\e861'; } /* '?' */ -.crycon-edit-2:before { content: '\e862'; } /* '?' */ -.crycon-block:before { content: '\e863'; } /* '?' */ +.crycon-search:before { content: '\e816'; } +.crycon-down-dir:before { content: '\e803'; } +.crycon-right-dir:before { content: '\e806'; } +.crycon-angle-left:before { content: '\e807'; } +.crycon-angle-right:before { content: '\e808'; } +.crycon-angle-up:before { content: '\e809'; } +.crycon-angle-down:before { content: '\e80a'; } +.crycon-minus:before { content: '\e80b'; } +.crycon-left-open:before { content: '\e80c'; } +.crycon-up:before { content: '\e80e'; } +.crycon-left-dir:before { content: '\e811'; } +.crycon-up-open:before { content: '\e812'; } +.crycon-ok:before { content: '\e813'; } +.crycon-cancel:before { content: '\e814'; } +.crycon-up-dir:before { content: '\e819'; } +.crycon-right-open:before { content: '\e81e'; } +.crycon-home:before { content: '\e81f'; } +.crycon-menu:before { content: '\e820'; } +.crycon-plus:before { content: '\e821'; } +.crycon-down-open:before { content: '\e822'; } +.crycon-down:before { content: '\e826'; } +.crycon-left:before { content: '\e827'; } +.crycon-right:before { content: '\e828'; } +.crycon-star-empty:before { content: '\e82c'; } +.crycon-star:before { content: '\e82d'; } +.crycon-mail:before { content: '\e82e'; } +.crycon-home-1:before { content: '\e82f'; } +.crycon-attach:before { content: '\e830'; } +.crycon-eye:before { content: '\e831'; } +.crycon-eye-off:before { content: '\e832'; } +.crycon-tags:before { content: '\e833'; } +.crycon-flag:before { content: '\e834'; } +.crycon-warning:before { content: '\e835'; } +.crycon-location:before { content: '\e836'; } +.crycon-trash:before { content: '\e837'; } +.crycon-doc:before { content: '\e838'; } +.crycon-phone:before { content: '\e839'; } +.crycon-cog:before { content: '\e83a'; } +.crycon-basket:before { content: '\e83b'; } +.crycon-basket-circled:before { content: '\e83c'; } +.crycon-wrench:before { content: '\e83d'; } +.crycon-wrench-circled:before { content: '\e83e'; } +.crycon-mic:before { content: '\e83f'; } +.crycon-volume:before { content: '\e840'; } +.crycon-volume-down:before { content: '\e841'; } +.crycon-volume-off:before { content: '\e842'; } +.crycon-headphones:before { content: '\e843'; } +.crycon-lightbulb:before { content: '\e844'; } +.crycon-resize-full:before { content: '\e845'; } +.crycon-resize-full-alt:before { content: '\e846'; } +.crycon-resize-small:before { content: '\e847'; } +.crycon-resize-vertical:before { content: '\e848'; } +.crycon-resize-horizontal:before { content: '\e849'; } +.crycon-move:before { content: '\e84a'; } +.crycon-zoom-in:before { content: '\e84b'; } +.crycon-zoom-out:before { content: '\e84c'; } +.crycon-arrows-cw:before { content: '\e84d'; } +.crycon-desktop:before { content: '\e84e'; } +.crycon-inbox:before { content: '\e84f'; } +.crycon-cloud:before { content: '\e850'; } +.crycon-book:before { content: '\e851'; } +.crycon-certificate:before { content: '\e852'; } +.crycon-tasks:before { content: '\e853'; } +.crycon-thumbs-up:before { content: '\e854'; } +.crycon-thumbs-down:before { content: '\e855'; } +.crycon-help-circled:before { content: '\e856'; } +.crycon-star-circled:before { content: '\e857'; } +.crycon-bell:before { content: '\e858'; } +.crycon-rss:before { content: '\e859'; } +.crycon-trash-circled:before { content: '\e85a'; } +.crycon-cogs:before { content: '\e85b'; } +.crycon-cog-circled:before { content: '\e85c'; } +.crycon-calendar-circled:before { content: '\e85d'; } +.crycon-mic-circled:before { content: '\e85e'; } +.crycon-volume-up:before { content: '\e85f'; } +.crycon-print:before { content: '\e860'; } +.crycon-edit-alt:before { content: '\e861'; } +.crycon-edit-2:before { content: '\e862'; } +.crycon-block:before { content: '\e863'; } + +/* = Gutenberg +-------------------------------------------------------------- */ + +.entry-content .wp-block-archives, +.entry-content .wp-block-categories, +.entry-content .wp-block-latest-posts { + padding: 0; + list-style: none; +} + +.wp-block-quote.is-large, .wp-block-quote.is-style-large { + padding: 2em; + margin-left: auto; + margin-right: auto; + font-size: 1.2em; +} + +.aligncenter[class^='wp-block']:not([class^='wp-block-cover']) { + display: table; +} + +.wp-block-separator { + max-width: 25%; +} +.wp-block-separator.is-style-wide { + max-width: 100%; +} +.wp-block-separator.is-style-dots::before { + color: inherit; +} + +.wp-block-button { + transition: .2s opacity; +} + +.wp-block-button:hover { + opacity: 0.85; +} + +#content p.has-regular-font-size, +#content p.has-large-font-size, +#content p.has-larger-font-size { + margin-bottom: 0.5em; + line-height: 1; +} + +.alignwide { + max-width: 115%; + margin-left: -6%; + margin-right: -6%; +} /* =Layout -------------------------------------------------------------- */ @@ -439,15 +491,16 @@ hr { color: #333; } -#content p:not(:last-child) { +.entry-content p:not(:last-child) { margin-bottom: 1em; } -.entry-content ul, .entry-summary ul { +.entry-content ul, +.entry-summary ul { margin-left: 1.5em; } -.entry-content ul, .entry-summary ul , +.entry-content ul, .entry-summary ul, .entry-content ol, .entry-summary ol { margin-bottom: 1.5em; } @@ -457,23 +510,32 @@ hr { padding-left: 20px; } -.entry-content li li { +.entry-content li li { margin-left: 15px; } +.entry-content ul[class^='wp-block'], +.entry-content ul[class^='wp-block'] > li, +.entry-content [class^='wp-block'] ul, +.entry-content [class^='wp-block'] ul > li { + margin-left: 0; + padding-left: 0; + background-image: none; +} + ol { - list-style: decimal; + list-style-type: decimal; margin-left: 1.5em; } ol ol { - list-style: upper-alpha; + list-style-type: upper-alpha; } ol ol ol { - list-style: lower-roman; + list-style-type: lower-roman; } ol ol ol ol { - list-style: lower-alpha; + list-style-type: lower-alpha; } ul ul, ol ol, @@ -1469,49 +1531,49 @@ article.format-aside h3.entry-format { /* =Images -------------------------------------------------------------- */ -#content img { +.entry-content img { margin: 0; height: auto; max-width: 100%; } -#content table img { +.entry-content table img { max-width: initial; } -#content img:hover {} +img:hover {} -#content .alignleft, -#content img.alignleft { - display: inline; +.alignleft, +img.alignleft { float: left; margin-right: 24px; margin-top: 4px; } -#content .alignright, -#content img.alignright { - display: inline; +.alignright, +img.alignright { float: right; margin-top: 4px; margin-left: 24px; } -#content .aligncenter, -#content img.aligncenter { - display: block; +.aligncenter, +img.aligncenter { clear: both; margin-right: auto; margin-left: auto; } +img.aligncenter { + display: block; +} -#content img.alignleft, -#content img.alignright, -#content img.aligncenter { +img.alignleft, +img.alignright, +img.aligncenter { margin-bottom: 12px; } -#content .wp-caption { +.wp-caption { max-width: 100%; margin-bottom: 20px; padding: 34px 0 4px; @@ -1520,7 +1582,7 @@ article.format-aside h3.entry-format { border-radius: 2px; } -#content .wp-caption img { +.wp-caption img { width: 100%; margin: 0 auto; padding: 0; @@ -1528,14 +1590,14 @@ article.format-aside h3.entry-format { box-shadow: none; } -#content .wp-caption p.wp-caption-text { +.wp-caption p.wp-caption-text { padding: 10px; font-size: .9em; text-align: center; text-indent: 0; } -#content .wp-smiley { +.wp-smiley { width:auto !important; margin: 0; border: 0 !important; @@ -2051,9 +2113,16 @@ h3#reply-title { } .widget-container { + position: relative; margin: 0 0 40px 0; } +.widget-container::after { + content: ""; + display: block; + clear: both; +} + .widget-title { position: relative; width: 100%; diff --git a/themes/twentyfifteen/archive.php b/themes/twentyfifteen/archive.php index bb6021e3..26a9a4b4 100644 --- a/themes/twentyfifteen/archive.php +++ b/themes/twentyfifteen/archive.php @@ -9,7 +9,7 @@ * new template file for each one. For example, tag.php (Tag archives), * category.php (Category archives), author.php (Author archives), etc. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fifteen @@ -32,7 +32,8 @@ get_header(); ?> */ get_template_part( 'content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentyfifteen' ), - 'next_text' => __( 'Next page', 'twentyfifteen' ), - 'before_page_number' => '' . __( 'Page', 'twentyfifteen' ) . ' ', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentyfifteen' ), + 'next_text' => __( 'Next page', 'twentyfifteen' ), + 'before_page_number' => '' . __( 'Page', 'twentyfifteen' ) . ' ', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'content', 'none' ); diff --git a/themes/twentyfifteen/comments.php b/themes/twentyfifteen/comments.php index 6b97ec39..b7ab478a 100644 --- a/themes/twentyfifteen/comments.php +++ b/themes/twentyfifteen/comments.php @@ -26,23 +26,23 @@ if ( post_password_required() ) {

@@ -50,11 +50,13 @@ if ( post_password_required() ) {
    'ol', - 'short_ping' => true, - 'avatar_size' => 56, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 56, + ) + ); ?>
@@ -64,9 +66,9 @@ if ( post_password_required() ) { -

+ if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : + ?> +

diff --git a/themes/twentyfifteen/content-link.php b/themes/twentyfifteen/content-link.php index 2beb1f78..f9a31997 100644 --- a/themes/twentyfifteen/content-link.php +++ b/themes/twentyfifteen/content-link.php @@ -15,39 +15,43 @@
', esc_url( twentyfifteen_get_link_url() ) ), '' ); + if ( is_single() ) : + the_title( sprintf( '

', esc_url( twentyfifteen_get_link_url() ) ), '

' ); else : the_title( sprintf( '

', esc_url( twentyfifteen_get_link_url() ) ), '

' ); endif; - ?> + ?>
', '', false ) - ) ); + the_content( + sprintf( + __( 'Continue reading %s', 'twentyfifteen' ), + the_title( '', '', false ) + ) + ); - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?>
diff --git a/themes/twentyfifteen/content-none.php b/themes/twentyfifteen/content-none.php index f1d59be4..cf118d21 100644 --- a/themes/twentyfifteen/content-none.php +++ b/themes/twentyfifteen/content-none.php @@ -2,7 +2,7 @@ /** * The template part for displaying a message that posts cannot be found * - * Learn more: {@link https://codex.wordpress.org/Template_Hierarchy} + * Learn more: {@link https://developer.wordpress.org/themes/basics/template-hierarchy/} * * @package WordPress * @subpackage Twenty_Fifteen diff --git a/themes/twentyfifteen/content-page.php b/themes/twentyfifteen/content-page.php index 7d37daa7..5b9e796c 100644 --- a/themes/twentyfifteen/content-page.php +++ b/themes/twentyfifteen/content-page.php @@ -21,15 +21,17 @@
'', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?>
', '' ); ?> diff --git a/themes/twentyfifteen/content-search.php b/themes/twentyfifteen/content-search.php index 33e2d993..faa79f50 100644 --- a/themes/twentyfifteen/content-search.php +++ b/themes/twentyfifteen/content-search.php @@ -2,7 +2,7 @@ /** * The template part for displaying results in search pages * - * Learn more: {@link https://codex.wordpress.org/Template_Hierarchy} + * Learn more: {@link https://developer.wordpress.org/themes/basics/template-hierarchy/} * * @package WordPress * @subpackage Twenty_Fifteen diff --git a/themes/twentyfifteen/content.php b/themes/twentyfifteen/content.php index 24756007..1ac377af 100644 --- a/themes/twentyfifteen/content.php +++ b/themes/twentyfifteen/content.php @@ -18,37 +18,41 @@
', '' ); + if ( is_single() ) : + the_title( '

', '

' ); else : the_title( sprintf( '

', esc_url( get_permalink() ) ), '

' ); endif; - ?> + ?>
', '', false ) - ) ); + the_content( + sprintf( + __( 'Continue reading %s', 'twentyfifteen' ), + the_title( '', '', false ) + ) + ); - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + 'pagelink' => '' . __( 'Page', 'twentyfifteen' ) . ' %', + 'separator' => ', ', + ) + ); + ?>
diff --git a/themes/twentyfifteen/css/blocks.css b/themes/twentyfifteen/css/blocks.css index 82563902..fa9d935a 100644 --- a/themes/twentyfifteen/css/blocks.css +++ b/themes/twentyfifteen/css/blocks.css @@ -384,8 +384,6 @@ p.has-drop-cap:not(:focus)::first-letter { /* Button */ .wp-block-button .wp-block-button__link { - border: 0; - border-radius: 0; cursor: pointer; font-family: "Noto Sans", sans-serif; font-size: 12px; @@ -397,13 +395,27 @@ p.has-drop-cap:not(:focus)::first-letter { vertical-align: baseline; } +.entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link { + border: 0; +} + +.entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover { + border-bottom: 2px solid; +} + .wp-block-button__link { background-color: #333; color: #fff; } +.is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #333; +} + .wp-block-button__link:hover, -.wp-block-button__link:focus { +.wp-block-button__link:focus, +.is-style-outline .wp-block-button__link:hover, +.is-style-outline .wp-block-button__link:focus { background-color: #707070; background-color: rgba(51, 51, 51, 0.7); color: #fff; diff --git a/themes/twentyfifteen/css/editor-blocks.css b/themes/twentyfifteen/css/editor-blocks.css index 6076cab6..5b1e90c9 100644 --- a/themes/twentyfifteen/css/editor-blocks.css +++ b/themes/twentyfifteen/css/editor-blocks.css @@ -708,10 +708,6 @@ p.has-drop-cap:not(:focus)::first-letter { /* Button */ .wp-block-button .wp-block-button__link { - background-color: #333; - border: 0; - border-radius: 0; - color: #fff; cursor: pointer; font-family: "Noto Sans", sans-serif; font-size: 12px; @@ -722,6 +718,15 @@ p.has-drop-cap:not(:focus)::first-letter { vertical-align: baseline; } +.wp-block-button__link { + background-color: #333; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #333; +} + @media screen and (min-width: 46.25em) { .wp-block-button .wp-block-button__link { font-size: 14px; diff --git a/themes/twentyfifteen/functions.php b/themes/twentyfifteen/functions.php index 168bedd9..2713ba2c 100644 --- a/themes/twentyfifteen/functions.php +++ b/themes/twentyfifteen/functions.php @@ -42,182 +42,214 @@ if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) { } if ( ! function_exists( 'twentyfifteen_setup' ) ) : -/** - * Sets up theme defaults and registers support for various WordPress features. - * - * Note that this function is hooked into the after_setup_theme hook, which - * runs before the init hook. The init hook is too late for some features, such - * as indicating support for post thumbnails. - * - * @since Twenty Fifteen 1.0 - */ -function twentyfifteen_setup() { - - /* - * Make theme available for translation. - * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen - * If you're building a theme based on twentyfifteen, use a find and replace - * to change 'twentyfifteen' to the name of your theme in all the template files - */ - load_theme_textdomain( 'twentyfifteen' ); - - // Add default posts and comments RSS feed links to head. - add_theme_support( 'automatic-feed-links' ); - - /* - * Let WordPress manage the document title. - * By adding theme support, we declare that this theme does not use a - * hard-coded tag in the document head, and expect WordPress to - * provide it for us. - */ - add_theme_support( 'title-tag' ); - - /* - * Enable support for Post Thumbnails on posts and pages. - * - * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails - */ - add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 825, 510, true ); - - // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'primary' => __( 'Primary Menu', 'twentyfifteen' ), - 'social' => __( 'Social Links Menu', 'twentyfifteen' ), - ) ); - - /* - * Switch default core markup for search form, comment form, and comments - * to output valid HTML5. - */ - add_theme_support( 'html5', array( - 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' - ) ); - - /* - * Enable support for Post Formats. - * - * See: https://codex.wordpress.org/Post_Formats - */ - add_theme_support( 'post-formats', array( - 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat' - ) ); - - /* - * Enable support for custom logo. - * - * @since Twenty Fifteen 1.5 - */ - add_theme_support( 'custom-logo', array( - 'height' => 248, - 'width' => 248, - 'flex-height' => true, - ) ); - - $color_scheme = twentyfifteen_get_color_scheme(); - $default_color = trim( $color_scheme[0], '#' ); - - // Setup the WordPress core custom background feature. - /** - * Filter Twenty Fifteen custom-header support arguments. + * Sets up theme defaults and registers support for various WordPress features. * - * @since Twenty Fifteen 1.0 - * - * @param array $args { - * An array of custom-header support arguments. + * Note that this function is hooked into the after_setup_theme hook, which + * runs before the init hook. The init hook is too late for some features, such + * as indicating support for post thumbnails. * - * @type string $default-color Default color of the header. - * @type string $default-attachment Default attachment of the header. - * } - */ - add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array( - 'default-color' => $default_color, - 'default-attachment' => 'fixed', - ) ) ); - - /* - * This theme styles the visual editor to resemble the theme style, - * specifically font, colors, icons, and column width. + * @since Twenty Fifteen 1.0 */ - add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) ); - - // Load regular editor styles into the new block-based editor. - add_theme_support( 'editor-styles' ); - - // Load default block styles. - add_theme_support( 'wp-block-styles' ); - - // Add support for responsive embeds. - add_theme_support( 'responsive-embeds' ); - - // Add support for custom color scheme. - add_theme_support( 'editor-color-palette', array( - array( - 'name' => __( 'Dark Gray', 'twentyfifteen' ), - 'slug' => 'dark-gray', - 'color' => '#111', - ), - array( - 'name' => __( 'Light Gray', 'twentyfifteen' ), - 'slug' => 'light-gray', - 'color' => '#f1f1f1', - ), - array( - 'name' => __( 'White', 'twentyfifteen' ), - 'slug' => 'white', - 'color' => '#fff', - ), - array( - 'name' => __( 'Yellow', 'twentyfifteen' ), - 'slug' => 'yellow', - 'color' => '#f4ca16', - ), - array( - 'name' => __( 'Dark Brown', 'twentyfifteen' ), - 'slug' => 'dark-brown', - 'color' => '#352712', - ), - array( - 'name' => __( 'Medium Pink', 'twentyfifteen' ), - 'slug' => 'medium-pink', - 'color' => '#e53b51', - ), - array( - 'name' => __( 'Light Pink', 'twentyfifteen' ), - 'slug' => 'light-pink', - 'color' => '#ffe5d1', - ), - array( - 'name' => __( 'Dark Purple', 'twentyfifteen' ), - 'slug' => 'dark-purple', - 'color' => '#2e2256', - ), - array( - 'name' => __( 'Purple', 'twentyfifteen' ), - 'slug' => 'purple', - 'color' => '#674970', - ), - array( - 'name' => __( 'Blue Gray', 'twentyfifteen' ), - 'slug' => 'blue-gray', - 'color' => '#22313f', - ), - array( - 'name' => __( 'Bright Blue', 'twentyfifteen' ), - 'slug' => 'bright-blue', - 'color' => '#55c3dc', - ), - array( - 'name' => __( 'Light Blue', 'twentyfifteen' ), - 'slug' => 'light-blue', - 'color' => '#e9f2f9', - ), - ) ); - - // Indicate widget sidebars can use selective refresh in the Customizer. - add_theme_support( 'customize-selective-refresh-widgets' ); -} + function twentyfifteen_setup() { + + /* + * Make theme available for translation. + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen + * If you're building a theme based on twentyfifteen, use a find and replace + * to change 'twentyfifteen' to the name of your theme in all the template files + */ + load_theme_textdomain( 'twentyfifteen' ); + + // Add default posts and comments RSS feed links to head. + add_theme_support( 'automatic-feed-links' ); + + /* + * Let WordPress manage the document title. + * By adding theme support, we declare that this theme does not use a + * hard-coded <title> tag in the document head, and expect WordPress to + * provide it for us. + */ + add_theme_support( 'title-tag' ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails + */ + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 825, 510, true ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'primary' => __( 'Primary Menu', 'twentyfifteen' ), + 'social' => __( 'Social Links Menu', 'twentyfifteen' ), + ) + ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( + 'html5', + array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); + + /* + * Enable support for Post Formats. + * + * See: https://codex.wordpress.org/Post_Formats + */ + add_theme_support( + 'post-formats', + array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'status', + 'audio', + 'chat', + ) + ); + + /* + * Enable support for custom logo. + * + * @since Twenty Fifteen 1.5 + */ + add_theme_support( + 'custom-logo', + array( + 'height' => 248, + 'width' => 248, + 'flex-height' => true, + ) + ); + + $color_scheme = twentyfifteen_get_color_scheme(); + $default_color = trim( $color_scheme[0], '#' ); + + // Setup the WordPress core custom background feature. + + /** + * Filter Twenty Fifteen custom-header support arguments. + * + * @since Twenty Fifteen 1.0 + * + * @param array $args { + * An array of custom-header support arguments. + * + * @type string $default-color Default color of the header. + * @type string $default-attachment Default attachment of the header. + * } + */ + add_theme_support( + 'custom-background', + apply_filters( + 'twentyfifteen_custom_background_args', + array( + 'default-color' => $default_color, + 'default-attachment' => 'fixed', + ) + ) + ); + + /* + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, icons, and column width. + */ + add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) ); + + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Add support for custom color scheme. + add_theme_support( + 'editor-color-palette', + array( + array( + 'name' => __( 'Dark Gray', 'twentyfifteen' ), + 'slug' => 'dark-gray', + 'color' => '#111', + ), + array( + 'name' => __( 'Light Gray', 'twentyfifteen' ), + 'slug' => 'light-gray', + 'color' => '#f1f1f1', + ), + array( + 'name' => __( 'White', 'twentyfifteen' ), + 'slug' => 'white', + 'color' => '#fff', + ), + array( + 'name' => __( 'Yellow', 'twentyfifteen' ), + 'slug' => 'yellow', + 'color' => '#f4ca16', + ), + array( + 'name' => __( 'Dark Brown', 'twentyfifteen' ), + 'slug' => 'dark-brown', + 'color' => '#352712', + ), + array( + 'name' => __( 'Medium Pink', 'twentyfifteen' ), + 'slug' => 'medium-pink', + 'color' => '#e53b51', + ), + array( + 'name' => __( 'Light Pink', 'twentyfifteen' ), + 'slug' => 'light-pink', + 'color' => '#ffe5d1', + ), + array( + 'name' => __( 'Dark Purple', 'twentyfifteen' ), + 'slug' => 'dark-purple', + 'color' => '#2e2256', + ), + array( + 'name' => __( 'Purple', 'twentyfifteen' ), + 'slug' => 'purple', + 'color' => '#674970', + ), + array( + 'name' => __( 'Blue Gray', 'twentyfifteen' ), + 'slug' => 'blue-gray', + 'color' => '#22313f', + ), + array( + 'name' => __( 'Bright Blue', 'twentyfifteen' ), + 'slug' => 'bright-blue', + 'color' => '#55c3dc', + ), + array( + 'name' => __( 'Light Blue', 'twentyfifteen' ), + 'slug' => 'light-blue', + 'color' => '#e9f2f9', + ), + ) + ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); + } endif; // twentyfifteen_setup add_action( 'after_setup_theme', 'twentyfifteen_setup' ); @@ -229,80 +261,85 @@ add_action( 'after_setup_theme', 'twentyfifteen_setup' ); * @link https://codex.wordpress.org/Function_Reference/register_sidebar */ function twentyfifteen_widgets_init() { - register_sidebar( array( - 'name' => __( 'Widget Area', 'twentyfifteen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ), - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', - 'after_widget' => '</aside>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); + register_sidebar( + array( + 'name' => __( 'Widget Area', 'twentyfifteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ), + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', + 'after_widget' => '</aside>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); } add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) : -/** - * Register Google fonts for Twenty Fifteen. - * - * @since Twenty Fifteen 1.0 - * - * @return string Google fonts URL for the theme. - */ -function twentyfifteen_fonts_url() { - $fonts_url = ''; - $fonts = array(); - $subsets = 'latin,latin-ext'; - - /* - * Translators: If there are characters in your language that are not supported - * by Noto Sans, translate this to 'off'. Do not translate into your own language. + /** + * Register Google fonts for Twenty Fifteen. + * + * @since Twenty Fifteen 1.0 + * + * @return string Google fonts URL for the theme. */ - if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Noto Sans:400italic,700italic,400,700'; - } + function twentyfifteen_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* + * Translators: If there are characters in your language that are not supported + * by Noto Sans, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) { + $fonts[] = 'Noto Sans:400italic,700italic,400,700'; + } - /* - * Translators: If there are characters in your language that are not supported - * by Noto Serif, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Noto Serif:400italic,700italic,400,700'; - } + /* + * Translators: If there are characters in your language that are not supported + * by Noto Serif, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) { + $fonts[] = 'Noto Serif:400italic,700italic,400,700'; + } - /* - * Translators: If there are characters in your language that are not supported - * by Inconsolata, translate this to 'off'. Do not translate into your own language. - */ - if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) { - $fonts[] = 'Inconsolata:400,700'; - } + /* + * Translators: If there are characters in your language that are not supported + * by Inconsolata, translate this to 'off'. Do not translate into your own language. + */ + if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) { + $fonts[] = 'Inconsolata:400,700'; + } - /* - * Translators: To add an additional character subset specific to your language, - * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. - */ - $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' ); - - if ( 'cyrillic' == $subset ) { - $subsets .= ',cyrillic,cyrillic-ext'; - } elseif ( 'greek' == $subset ) { - $subsets .= ',greek,greek-ext'; - } elseif ( 'devanagari' == $subset ) { - $subsets .= ',devanagari'; - } elseif ( 'vietnamese' == $subset ) { - $subsets .= ',vietnamese'; - } + /* + * Translators: To add an additional character subset specific to your language, + * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. + */ + $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' ); + + if ( 'cyrillic' == $subset ) { + $subsets .= ',cyrillic,cyrillic-ext'; + } elseif ( 'greek' == $subset ) { + $subsets .= ',greek,greek-ext'; + } elseif ( 'devanagari' == $subset ) { + $subsets .= ',devanagari'; + } elseif ( 'vietnamese' == $subset ) { + $subsets .= ',vietnamese'; + } - if ( $fonts ) { - $fonts_url = add_query_arg( array( - 'family' => urlencode( implode( '|', $fonts ) ), - 'subset' => urlencode( $subsets ), - ), 'https://fonts.googleapis.com/css' ); - } + if ( $fonts ) { + $fonts_url = add_query_arg( + array( + 'family' => urlencode( implode( '|', $fonts ) ), + 'subset' => urlencode( $subsets ), + ), + 'https://fonts.googleapis.com/css' + ); + } - return $fonts_url; -} + return $fonts_url; + } endif; /** @@ -333,7 +370,7 @@ function twentyfifteen_scripts() { wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri() ); // Theme block stylesheet. - wp_enqueue_style( 'twentyfifteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfifteen-style' ), '20181018' ); + wp_enqueue_style( 'twentyfifteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfifteen-style' ), '20181230' ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20141010' ); @@ -354,10 +391,14 @@ function twentyfifteen_scripts() { } wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true ); - wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array( - 'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>', - 'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>', - ) ); + wp_localize_script( + 'twentyfifteen-script', + 'screenReaderText', + array( + 'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>', + 'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>', + ) + ); } add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); @@ -368,7 +409,7 @@ add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); */ function twentyfifteen_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentyfifteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' ); + wp_enqueue_style( 'twentyfifteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' ); // Add custom fonts. wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null ); } @@ -420,9 +461,9 @@ function twentyfifteen_post_nav_background() { return; } - if ( $previous && has_post_thumbnail( $previous->ID ) ) { + if ( $previous && has_post_thumbnail( $previous->ID ) ) { $prevthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $previous->ID ), 'post-thumbnail' ); - $css .= ' + $css .= ' .post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); } .post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; } .post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); } @@ -431,7 +472,7 @@ function twentyfifteen_post_nav_background() { if ( $next && has_post_thumbnail( $next->ID ) ) { $nextthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $next->ID ), 'post-thumbnail' ); - $css .= ' + $css .= ' .post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); border-top: 0; } .post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; } .post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); } diff --git a/themes/twentyfifteen/header.php b/themes/twentyfifteen/header.php index 28de34ed..63b04377 100644 --- a/themes/twentyfifteen/header.php +++ b/themes/twentyfifteen/header.php @@ -14,7 +14,7 @@ <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <link rel="profile" href="http://gmpg.org/xfn/11"> - <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> + <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>"> <!--[if lt IE 9]> <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js"></script> <![endif]--> @@ -31,17 +31,21 @@ <?php twentyfifteen_the_custom_logo(); - if ( is_front_page() && is_home() ) : ?> + if ( is_front_page() && is_home() ) : + ?> <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php else : ?> <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> - <?php endif; + <?php + endif; $description = get_bloginfo( 'description', 'display' ); - if ( $description || is_customize_preview() ) : ?> + if ( $description || is_customize_preview() ) : + ?> <p class="site-description"><?php echo $description; ?></p> - <?php endif; - ?> + <?php + endif; + ?> <button class="secondary-toggle"><?php _e( 'Menu and widgets', 'twentyfifteen' ); ?></button> </div><!-- .site-branding --> </header><!-- .site-header --> diff --git a/themes/twentyfifteen/image.php b/themes/twentyfifteen/image.php index 5a471d40..5afa773f 100644 --- a/themes/twentyfifteen/image.php +++ b/themes/twentyfifteen/image.php @@ -14,38 +14,39 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); - ?> - - <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> + while ( have_posts() ) : + the_post(); + ?> - <nav id="image-navigation" class="navigation image-navigation"> - <div class="nav-links"> - <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div> - </div><!-- .nav-links --> - </nav><!-- .image-navigation --> + <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> - <header class="entry-header"> - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> - </header><!-- .entry-header --> + <nav id="image-navigation" class="navigation image-navigation"> + <div class="nav-links"> + <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div> + </div><!-- .nav-links --> + </nav><!-- .image-navigation --> - <div class="entry-content"> + <header class="entry-header"> + <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> + </header><!-- .entry-header --> - <div class="entry-attachment"> - <?php - /** - * Filter the default Twenty Fifteen image attachment size. - * - * @since Twenty Fifteen 1.0 - * - * @param string $image_size Image size. Default 'large'. - */ - $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' ); + <div class="entry-content"> - echo wp_get_attachment_image( get_the_ID(), $image_size ); - ?> + <div class="entry-attachment"> + <?php + /** + * Filter the default Twenty Fifteen image attachment size. + * + * @since Twenty Fifteen 1.0 + * + * @param string $image_size Image size. Default 'large'. + */ + $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' ); + + echo wp_get_attachment_image( get_the_ID(), $image_size ); + ?> - <?php if ( has_excerpt() ) : ?> + <?php if ( has_excerpt() ) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div><!-- .entry-caption --> @@ -54,35 +55,39 @@ get_header(); ?> </div><!-- .entry-attachment --> <?php - the_content(); - wp_link_pages( array( + the_content(); + wp_link_pages( + array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + ) + ); ?> </div><!-- .entry-content --> <footer class="entry-footer"> - <?php twentyfifteen_entry_meta(); ?> + <?php twentyfifteen_entry_meta(); ?> <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> <?php - // If comments are open or we have at least one comment, load up the comment template - if ( comments_open() || get_comments_number() ) : - comments_template(); + // If comments are open or we have at least one comment, load up the comment template + if ( comments_open() || get_comments_number() ) : + comments_template(); endif; - // Previous/next post navigation. - the_post_navigation( array( + // Previous/next post navigation. + the_post_navigation( + array( 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ), - ) ); + ) + ); // End the loop. endwhile; diff --git a/themes/twentyfifteen/inc/back-compat.php b/themes/twentyfifteen/inc/back-compat.php index 73cd44d1..a4f03e3a 100644 --- a/themes/twentyfifteen/inc/back-compat.php +++ b/themes/twentyfifteen/inc/back-compat.php @@ -44,9 +44,13 @@ function twentyfifteen_upgrade_notice() { * @since Twenty Fifteen 1.0 */ function twentyfifteen_customize() { - wp_die( sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Fifteen requires at least WordPress version 4.1. You are running version %s. Please upgrade and try again.', 'twentyfifteen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentyfifteen_customize' ); diff --git a/themes/twentyfifteen/inc/custom-header.php b/themes/twentyfifteen/inc/custom-header.php index 10d0ef1a..763ef00d 100644 --- a/themes/twentyfifteen/inc/custom-header.php +++ b/themes/twentyfifteen/inc/custom-header.php @@ -13,8 +13,8 @@ * @uses twentyfifteen_header_style() */ function twentyfifteen_custom_header_setup() { - $color_scheme = twentyfifteen_get_color_scheme(); - $default_text_color = trim( $color_scheme[4], '#' ); + $color_scheme = twentyfifteen_get_color_scheme(); + $default_text_color = trim( $color_scheme[4], '#' ); /** * Filter Twenty Fifteen custom-header support arguments. @@ -31,12 +31,18 @@ function twentyfifteen_custom_header_setup() { * displayed on the blog. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentyfifteen_custom_header_args', array( - 'default-text-color' => $default_text_color, - 'width' => 954, - 'height' => 1300, - 'wp-head-callback' => 'twentyfifteen_header_style', - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + 'twentyfifteen_custom_header_args', + array( + 'default-text-color' => $default_text_color, + 'width' => 954, + 'height' => 1300, + 'wp-head-callback' => 'twentyfifteen_header_style', + ) + ) + ); } add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' ); @@ -53,10 +59,10 @@ function twentyfifteen_hex2rgb( $color ) { $color = trim( $color, '#' ); if ( strlen( $color ) == 3 ) { - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); - } else if ( strlen( $color ) == 6 ) { + $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); + $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); + $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); + } elseif ( strlen( $color ) == 6 ) { $r = hexdec( substr( $color, 0, 2 ) ); $g = hexdec( substr( $color, 2, 2 ) ); $b = hexdec( substr( $color, 4, 2 ) ); @@ -64,32 +70,36 @@ function twentyfifteen_hex2rgb( $color ) { return array(); } - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); + return array( + 'red' => $r, + 'green' => $g, + 'blue' => $b, + ); } if ( ! function_exists( 'twentyfifteen_header_style' ) ) : -/** - * Styles the header image and text displayed on the blog. - * - * @since Twenty Fifteen 1.0 - * - * @see twentyfifteen_custom_header_setup() - */ -function twentyfifteen_header_style() { - $header_image = get_header_image(); + /** + * Styles the header image and text displayed on the blog. + * + * @since Twenty Fifteen 1.0 + * + * @see twentyfifteen_custom_header_setup() + */ + function twentyfifteen_header_style() { + $header_image = get_header_image(); - // If no custom options for text are set, let's bail. - if ( empty( $header_image ) && display_header_text() ) { - return; - } + // If no custom options for text are set, let's bail. + if ( empty( $header_image ) && display_header_text() ) { + return; + } - // If we get this far, we have custom styles. Let's do this. - ?> - <style type="text/css" id="twentyfifteen-header-css"> - <?php + // If we get this far, we have custom styles. Let's do this. + ?> + <style type="text/css" id="twentyfifteen-header-css"> + <?php // Short header for when there is no Custom Header and Header Text is hidden. if ( empty( $header_image ) && ! display_header_text() ) : - ?> + ?> .site-header { padding-top: 14px; padding-bottom: 14px; @@ -126,12 +136,12 @@ function twentyfifteen_header_style() { min-height: 0; } } - <?php + <?php endif; // Has a Custom Header been added? if ( ! empty( $header_image ) ) : - ?> + ?> .site-header { /* @@ -168,12 +178,12 @@ function twentyfifteen_header_style() { background: transparent; } } - <?php + <?php endif; // Has the text been hidden? if ( ! display_header_text() ) : - ?> + ?> .site-title, .site-description { clip: rect(1px, 1px, 1px, 1px); @@ -181,8 +191,8 @@ function twentyfifteen_header_style() { } <?php endif; ?> </style> - <?php -} + <?php + } endif; // twentyfifteen_header_style /** diff --git a/themes/twentyfifteen/inc/customizer.php b/themes/twentyfifteen/inc/customizer.php index c31c57e8..3b74f243 100644 --- a/themes/twentyfifteen/inc/customizer.php +++ b/themes/twentyfifteen/inc/customizer.php @@ -21,61 +21,91 @@ function twentyfifteen_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'container_inclusive' => false, - 'render_callback' => 'twentyfifteen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentyfifteen_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyfifteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyfifteen_customize_partial_blogdescription', + ) + ); } // Add color scheme setting and control. - $wp_customize->add_setting( 'color_scheme', array( - 'default' => 'default', - 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( 'color_scheme', array( - 'label' => __( 'Base Color Scheme', 'twentyfifteen' ), - 'section' => 'colors', - 'type' => 'select', - 'choices' => twentyfifteen_get_color_scheme_choices(), - 'priority' => 1, - ) ); + $wp_customize->add_setting( + 'color_scheme', + array( + 'default' => 'default', + 'sanitize_callback' => 'twentyfifteen_sanitize_color_scheme', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'color_scheme', + array( + 'label' => __( 'Base Color Scheme', 'twentyfifteen' ), + 'section' => 'colors', + 'type' => 'select', + 'choices' => twentyfifteen_get_color_scheme_choices(), + 'priority' => 1, + ) + ); // Add custom header and sidebar text color setting and control. - $wp_customize->add_setting( 'sidebar_textcolor', array( - 'default' => $color_scheme[4], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_textcolor', array( - 'label' => __( 'Header and Sidebar Text Color', 'twentyfifteen' ), - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_setting( + 'sidebar_textcolor', + array( + 'default' => $color_scheme[4], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'sidebar_textcolor', + array( + 'label' => __( 'Header and Sidebar Text Color', 'twentyfifteen' ), + 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), + 'section' => 'colors', + ) + ) + ); // Remove the core header textcolor control, as it shares the sidebar text color. $wp_customize->remove_control( 'header_textcolor' ); // Add custom header and sidebar background color setting and control. - $wp_customize->add_setting( 'header_background_color', array( - 'default' => $color_scheme[1], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array( - 'label' => __( 'Header and Sidebar Background Color', 'twentyfifteen' ), - 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_setting( + 'header_background_color', + array( + 'default' => $color_scheme[1], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'header_background_color', + array( + 'label' => __( 'Header and Sidebar Background Color', 'twentyfifteen' ), + 'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ), + 'section' => 'colors', + ) + ) + ); // Add an additional description to the header image section. $wp_customize->get_section( 'header_image' )->description = __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ); @@ -145,134 +175,137 @@ function twentyfifteen_get_color_schemes() { * } * } */ - return apply_filters( 'twentyfifteen_color_schemes', array( - 'default' => array( - 'label' => __( 'Default', 'twentyfifteen' ), - 'colors' => array( - '#f1f1f1', - '#ffffff', - '#ffffff', - '#333333', - '#333333', - '#f7f7f7', + return apply_filters( + 'twentyfifteen_color_schemes', + array( + 'default' => array( + 'label' => __( 'Default', 'twentyfifteen' ), + 'colors' => array( + '#f1f1f1', + '#ffffff', + '#ffffff', + '#333333', + '#333333', + '#f7f7f7', + ), ), - ), - 'dark' => array( - 'label' => __( 'Dark', 'twentyfifteen' ), - 'colors' => array( - '#111111', - '#202020', - '#202020', - '#bebebe', - '#bebebe', - '#1b1b1b', + 'dark' => array( + 'label' => __( 'Dark', 'twentyfifteen' ), + 'colors' => array( + '#111111', + '#202020', + '#202020', + '#bebebe', + '#bebebe', + '#1b1b1b', + ), ), - ), - 'yellow' => array( - 'label' => __( 'Yellow', 'twentyfifteen' ), - 'colors' => array( - '#f4ca16', - '#ffdf00', - '#ffffff', - '#111111', - '#111111', - '#f1f1f1', + 'yellow' => array( + 'label' => __( 'Yellow', 'twentyfifteen' ), + 'colors' => array( + '#f4ca16', + '#ffdf00', + '#ffffff', + '#111111', + '#111111', + '#f1f1f1', + ), ), - ), - 'pink' => array( - 'label' => __( 'Pink', 'twentyfifteen' ), - 'colors' => array( - '#ffe5d1', - '#e53b51', - '#ffffff', - '#352712', - '#ffffff', - '#f1f1f1', + 'pink' => array( + 'label' => __( 'Pink', 'twentyfifteen' ), + 'colors' => array( + '#ffe5d1', + '#e53b51', + '#ffffff', + '#352712', + '#ffffff', + '#f1f1f1', + ), ), - ), - 'purple' => array( - 'label' => __( 'Purple', 'twentyfifteen' ), - 'colors' => array( - '#674970', - '#2e2256', - '#ffffff', - '#2e2256', - '#ffffff', - '#f1f1f1', + 'purple' => array( + 'label' => __( 'Purple', 'twentyfifteen' ), + 'colors' => array( + '#674970', + '#2e2256', + '#ffffff', + '#2e2256', + '#ffffff', + '#f1f1f1', + ), ), - ), - 'blue' => array( - 'label' => __( 'Blue', 'twentyfifteen' ), - 'colors' => array( - '#e9f2f9', - '#55c3dc', - '#ffffff', - '#22313f', - '#ffffff', - '#f1f1f1', + 'blue' => array( + 'label' => __( 'Blue', 'twentyfifteen' ), + 'colors' => array( + '#e9f2f9', + '#55c3dc', + '#ffffff', + '#22313f', + '#ffffff', + '#f1f1f1', + ), ), - ), - ) ); + ) + ); } if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) : -/** - * Get the current Twenty Fifteen color scheme. - * - * @since Twenty Fifteen 1.0 - * - * @return array An associative array of either the current or default color scheme hex values. - */ -function twentyfifteen_get_color_scheme() { - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); - $color_schemes = twentyfifteen_get_color_schemes(); + /** + * Get the current Twenty Fifteen color scheme. + * + * @since Twenty Fifteen 1.0 + * + * @return array An associative array of either the current or default color scheme hex values. + */ + function twentyfifteen_get_color_scheme() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + $color_schemes = twentyfifteen_get_color_schemes(); - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { - return $color_schemes[ $color_scheme_option ]['colors']; - } + if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { + return $color_schemes[ $color_scheme_option ]['colors']; + } - return $color_schemes['default']['colors']; -} + return $color_schemes['default']['colors']; + } endif; // twentyfifteen_get_color_scheme if ( ! function_exists( 'twentyfifteen_get_color_scheme_choices' ) ) : -/** - * Returns an array of color scheme choices registered for Twenty Fifteen. - * - * @since Twenty Fifteen 1.0 - * - * @return array Array of color schemes. - */ -function twentyfifteen_get_color_scheme_choices() { - $color_schemes = twentyfifteen_get_color_schemes(); - $color_scheme_control_options = array(); + /** + * Returns an array of color scheme choices registered for Twenty Fifteen. + * + * @since Twenty Fifteen 1.0 + * + * @return array Array of color schemes. + */ + function twentyfifteen_get_color_scheme_choices() { + $color_schemes = twentyfifteen_get_color_schemes(); + $color_scheme_control_options = array(); - foreach ( $color_schemes as $color_scheme => $value ) { - $color_scheme_control_options[ $color_scheme ] = $value['label']; - } + foreach ( $color_schemes as $color_scheme => $value ) { + $color_scheme_control_options[ $color_scheme ] = $value['label']; + } - return $color_scheme_control_options; -} + return $color_scheme_control_options; + } endif; // twentyfifteen_get_color_scheme_choices if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) : -/** - * Sanitization callback for color schemes. - * - * @since Twenty Fifteen 1.0 - * - * @param string $value Color scheme name value. - * @return string Color scheme name. - */ -function twentyfifteen_sanitize_color_scheme( $value ) { - $color_schemes = twentyfifteen_get_color_scheme_choices(); + /** + * Sanitization callback for color schemes. + * + * @since Twenty Fifteen 1.0 + * + * @param string $value Color scheme name value. + * @return string Color scheme name. + */ + function twentyfifteen_sanitize_color_scheme( $value ) { + $color_schemes = twentyfifteen_get_color_scheme_choices(); - if ( ! array_key_exists( $value, $color_schemes ) ) { - $value = 'default'; - } + if ( ! array_key_exists( $value, $color_schemes ) ) { + $value = 'default'; + } - return $value; -} + return $value; + } endif; // twentyfifteen_sanitize_color_scheme /** @@ -295,7 +328,7 @@ function twentyfifteen_color_scheme_css() { // Convert main and sidebar text hex color to rgba. $color_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[3] ); $color_sidebar_textcolor_rgb = twentyfifteen_hex2rgb( $color_scheme[4] ); - $colors = array( + $colors = array( 'background_color' => $color_scheme[0], 'header_background_color' => $color_scheme[1], 'box_background_color' => $color_scheme[2], @@ -348,20 +381,23 @@ add_action( 'customize_preview_init', 'twentyfifteen_customize_preview_js' ); * @return string Color scheme CSS. */ function twentyfifteen_get_color_scheme_css( $colors ) { - $colors = wp_parse_args( $colors, array( - 'background_color' => '', - 'header_background_color' => '', - 'box_background_color' => '', - 'textcolor' => '', - 'secondary_textcolor' => '', - 'border_color' => '', - 'border_focus_color' => '', - 'sidebar_textcolor' => '', - 'sidebar_border_color' => '', - 'sidebar_border_focus_color' => '', - 'secondary_sidebar_textcolor' => '', - 'meta_box_background_color' => '', - ) ); + $colors = wp_parse_args( + $colors, + array( + 'background_color' => '', + 'header_background_color' => '', + 'box_background_color' => '', + 'textcolor' => '', + 'secondary_textcolor' => '', + 'border_color' => '', + 'border_focus_color' => '', + 'sidebar_textcolor' => '', + 'sidebar_border_color' => '', + 'sidebar_border_focus_color' => '', + 'secondary_sidebar_textcolor' => '', + 'meta_box_background_color' => '', + ) + ); $css = <<<CSS /* Color Scheme */ diff --git a/themes/twentyfifteen/inc/template-tags.php b/themes/twentyfifteen/inc/template-tags.php index 7b4ffeb7..056d1941 100644 --- a/themes/twentyfifteen/inc/template-tags.php +++ b/themes/twentyfifteen/inc/template-tags.php @@ -10,120 +10,127 @@ */ if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) : -/** - * Display navigation to next/previous comments when applicable. - * - * @since Twenty Fifteen 1.0 - */ -function twentyfifteen_comment_nav() { - // Are there comments to navigate through? - if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : - ?> - <nav class="navigation comment-navigation" role="navigation"> + /** + * Display navigation to next/previous comments when applicable. + * + * @since Twenty Fifteen 1.0 + */ + function twentyfifteen_comment_nav() { + // Are there comments to navigate through? + if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : + ?> + <nav class="navigation comment-navigation" role="navigation"> <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2> <div class="nav-links"> <?php - if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) : - printf( '<div class="nav-previous">%s</div>', $prev_link ); + if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) : + printf( '<div class="nav-previous">%s</div>', $prev_link ); endif; - if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) : - printf( '<div class="nav-next">%s</div>', $next_link ); + if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) : + printf( '<div class="nav-next">%s</div>', $next_link ); endif; ?> - </div><!-- .nav-links --> - </nav><!-- .comment-navigation --> - <?php - endif; -} + </div><!-- .nav-links --> + </nav><!-- .comment-navigation --> + <?php + endif; + } endif; if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) : -/** - * Prints HTML with meta information for the categories, tags. - * - * @since Twenty Fifteen 1.0 - */ -function twentyfifteen_entry_meta() { - if ( is_sticky() && is_home() && ! is_paged() ) { - printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) ); - } - - $format = get_post_format(); - if ( current_theme_supports( 'post-formats', $format ) ) { - printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', - sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ), - esc_url( get_post_format_link( $format ) ), - get_post_format_string( $format ) - ); - } - - if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { - $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; + /** + * Prints HTML with meta information for the categories, tags. + * + * @since Twenty Fifteen 1.0 + */ + function twentyfifteen_entry_meta() { + if ( is_sticky() && is_home() && ! is_paged() ) { + printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) ); + } - 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>'; + $format = get_post_format(); + if ( current_theme_supports( 'post-formats', $format ) ) { + printf( + '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', + sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ), + esc_url( get_post_format_link( $format ) ), + get_post_format_string( $format ) + ); } - $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), - get_the_date(), - esc_attr( get_the_modified_date( 'c' ) ), - get_the_modified_date() - ); + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; - printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', - _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ), - esc_url( get_permalink() ), - $time_string - ); - } + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; + } - if ( 'post' == get_post_type() ) { - if ( is_singular() || is_multi_author() ) { - printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', - _x( 'Author', 'Used before post author name.', 'twentyfifteen' ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() + $time_string = sprintf( + $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() ); - } - $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); - if ( $categories_list && twentyfifteen_categorized_blog() ) { - printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', - _x( 'Categories', 'Used before category names.', 'twentyfifteen' ), - $categories_list + printf( + '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', + _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ), + esc_url( get_permalink() ), + $time_string ); } - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); - if ( $tags_list && ! is_wp_error( $tags_list ) ) { - printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', - _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ), - $tags_list - ); + if ( 'post' == get_post_type() ) { + if ( is_singular() || is_multi_author() ) { + printf( + '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', + _x( 'Author', 'Used before post author name.', 'twentyfifteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } + + $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); + if ( $categories_list && twentyfifteen_categorized_blog() ) { + printf( + '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', + _x( 'Categories', 'Used before category names.', 'twentyfifteen' ), + $categories_list + ); + } + + $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); + if ( $tags_list && ! is_wp_error( $tags_list ) ) { + printf( + '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', + _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ), + $tags_list + ); + } } - } - if ( is_attachment() && wp_attachment_is_image() ) { - // Retrieve attachment metadata. - $metadata = wp_get_attachment_metadata(); + if ( is_attachment() && wp_attachment_is_image() ) { + // Retrieve attachment metadata. + $metadata = wp_get_attachment_metadata(); - printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', - _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ), - esc_url( wp_get_attachment_url() ), - $metadata['width'], - $metadata['height'] - ); - } + printf( + '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', + _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ), + esc_url( wp_get_attachment_url() ), + $metadata['width'], + $metadata['height'] + ); + } - if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - echo '<span class="comments-link">'; - /* translators: %s: post title */ - comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) ); - echo '</span>'; + if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo '<span class="comments-link">'; + /* translators: %s: post title */ + comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) ); + echo '</span>'; + } } -} endif; /** @@ -136,13 +143,15 @@ endif; function twentyfifteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) { // Create an array of all the categories that are attached to posts. - $all_the_cool_cats = get_categories( array( - 'fields' => 'ids', - 'hide_empty' => 1, + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + 'hide_empty' => 1, - // We only need to know if there is more than one category. - 'number' => 2, - ) ); + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); @@ -169,27 +178,27 @@ function twentyfifteen_category_transient_flusher() { delete_transient( 'twentyfifteen_categories' ); } add_action( 'edit_category', 'twentyfifteen_category_transient_flusher' ); -add_action( 'save_post', 'twentyfifteen_category_transient_flusher' ); +add_action( 'save_post', 'twentyfifteen_category_transient_flusher' ); if ( ! function_exists( 'twentyfifteen_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 Fifteen 1.0 - */ -function twentyfifteen_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 Fifteen 1.0 + */ + function twentyfifteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> - <div class="post-thumbnail"> - <?php the_post_thumbnail(); ?> + <div class="post-thumbnail"> + <?php the_post_thumbnail(); ?> </div><!-- .post-thumbnail --> <?php else : ?> @@ -200,59 +209,61 @@ function twentyfifteen_post_thumbnail() { ?> </a> - <?php endif; // End is_singular() -} + <?php + endif; // End is_singular() + } endif; if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) : -/** - * Return the post URL. - * - * Falls back to the post permalink if no URL is found in the post. - * - * @since Twenty Fifteen 1.0 - * - * @see get_url_in_content() - * - * @return string The Link format URL. - */ -function twentyfifteen_get_link_url() { - $has_url = get_url_in_content( get_the_content() ); + /** + * Return the post URL. + * + * Falls back to the post permalink if no URL is found in the post. + * + * @since Twenty Fifteen 1.0 + * + * @see get_url_in_content() + * + * @return string The Link format URL. + */ + function twentyfifteen_get_link_url() { + $has_url = get_url_in_content( get_the_content() ); - return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); -} + return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); + } endif; if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) : -/** - * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link. - * - * @since Twenty Fifteen 1.0 - * - * @return string 'Continue reading' link prepended with an ellipsis. - */ -function twentyfifteen_excerpt_more( $more ) { - $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', - esc_url( get_permalink( get_the_ID() ) ), - /* translators: %s: Name of current post */ - sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link. + * + * @since Twenty Fifteen 1.0 + * + * @return string 'Continue reading' link prepended with an ellipsis. + */ + function twentyfifteen_excerpt_more( $more ) { + $link = sprintf( + '<a href="%1$s" class="more-link">%2$s</a>', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' ); endif; if ( ! function_exists( 'twentyfifteen_the_custom_logo' ) ) : -/** - * Displays the optional custom logo. - * - * Does nothing if the custom logo is not available. - * - * @since Twenty Fifteen 1.5 - */ -function twentyfifteen_the_custom_logo() { - if ( function_exists( 'the_custom_logo' ) ) { - the_custom_logo(); + /** + * Displays the optional custom logo. + * + * Does nothing if the custom logo is not available. + * + * @since Twenty Fifteen 1.5 + */ + function twentyfifteen_the_custom_logo() { + if ( function_exists( 'the_custom_logo' ) ) { + the_custom_logo(); + } } -} endif; diff --git a/themes/twentyfifteen/index.php b/themes/twentyfifteen/index.php index db77651e..4abac6a1 100644 --- a/themes/twentyfifteen/index.php +++ b/themes/twentyfifteen/index.php @@ -7,7 +7,7 @@ * It is used to display a page when nothing more specific matches a query. * e.g., it puts together the home page when no home.php file exists. * - * Learn more: {@link https://codex.wordpress.org/Template_Hierarchy} + * Learn more: {@link https://developer.wordpress.org/themes/basics/template-hierarchy/} * * @package WordPress * @subpackage Twenty_Fifteen @@ -29,7 +29,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -38,17 +39,19 @@ get_header(); ?> */ get_template_part( 'content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentyfifteen' ), - 'next_text' => __( 'Next page', 'twentyfifteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentyfifteen' ), + 'next_text' => __( 'Next page', 'twentyfifteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'content', 'none' ); diff --git a/themes/twentyfifteen/js/functions.js b/themes/twentyfifteen/js/functions.js index 2da5cbc3..b9dddc85 100644 --- a/themes/twentyfifteen/js/functions.js +++ b/themes/twentyfifteen/js/functions.js @@ -77,7 +77,8 @@ } )(); /** - * @summary Add or remove ARIA attributes. + * Add or remove ARIA attributes. + * * Uses jQuery's width() function to determine the size of the window and add * the default ARIA attributes for the menu toggle if it's visible. * @since Twenty Fifteen 1.1 diff --git a/themes/twentyfifteen/page.php b/themes/twentyfifteen/page.php index 5c7a0b07..50d0bf1c 100644 --- a/themes/twentyfifteen/page.php +++ b/themes/twentyfifteen/page.php @@ -18,7 +18,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); // Include the page content template. get_template_part( 'content', 'page' ); @@ -28,7 +29,7 @@ get_header(); ?> comments_template(); endif; - // End the loop. + // End the loop. endwhile; ?> diff --git a/themes/twentyfifteen/readme.txt b/themes/twentyfifteen/readme.txt index 7bc7d625..a28aa0cf 100644 --- a/themes/twentyfifteen/readme.txt +++ b/themes/twentyfifteen/readme.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 4.1 Tested up to: WordPress 5.0 -Version: 2.2 +Version: 2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready @@ -55,6 +55,16 @@ Source: http://www.genericons.com == Changelog == += 2.4 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Fifteen_Theme_Changelog#Version_2.4 + += 2.3 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Fifteen_Theme_Changelog#Version_2.3 + = 2.2 = * Released: December 19, 2018 diff --git a/themes/twentyfifteen/search.php b/themes/twentyfifteen/search.php index 33528415..f3778f34 100644 --- a/themes/twentyfifteen/search.php +++ b/themes/twentyfifteen/search.php @@ -20,7 +20,9 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); ?> + while ( have_posts() ) : + the_post(); + ?> <?php /* @@ -30,17 +32,19 @@ get_header(); ?> */ get_template_part( 'content', 'search' ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentyfifteen' ), - 'next_text' => __( 'Next page', 'twentyfifteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', - ) ); - - // If no content, include the "No posts found" template. + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentyfifteen' ), + 'next_text' => __( 'Next page', 'twentyfifteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', + ) + ); + + // If no content, include the "No posts found" template. else : get_template_part( 'content', 'none' ); diff --git a/themes/twentyfifteen/sidebar.php b/themes/twentyfifteen/sidebar.php index 02308efc..f2326a8c 100644 --- a/themes/twentyfifteen/sidebar.php +++ b/themes/twentyfifteen/sidebar.php @@ -7,17 +7,19 @@ * @since Twenty Fifteen 1.0 */ -if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) ) : ?> +if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) ) : ?> <div id="secondary" class="secondary"> <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav id="site-navigation" class="main-navigation" role="navigation"> <?php // Primary navigation menu. - wp_nav_menu( array( - 'menu_class' => 'nav-menu', - 'theme_location' => 'primary', - ) ); + wp_nav_menu( + array( + 'menu_class' => 'nav-menu', + 'theme_location' => 'primary', + ) + ); ?> </nav><!-- .main-navigation --> <?php endif; ?> @@ -26,12 +28,14 @@ if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( <nav id="social-navigation" class="social-navigation" role="navigation"> <?php // Social links navigation menu. - wp_nav_menu( array( - 'theme_location' => 'social', - 'depth' => 1, - 'link_before' => '<span class="screen-reader-text">', - 'link_after' => '</span>', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>', + ) + ); ?> </nav><!-- .social-navigation --> <?php endif; ?> diff --git a/themes/twentyfifteen/single.php b/themes/twentyfifteen/single.php index fda8b5ec..4de3a493 100644 --- a/themes/twentyfifteen/single.php +++ b/themes/twentyfifteen/single.php @@ -14,7 +14,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the post format-specific template for the content. If you want to @@ -29,16 +30,18 @@ get_header(); ?> endif; // Previous/next post navigation. - the_post_navigation( array( - 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - ) ); - - // End the loop. + the_post_navigation( + array( + 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + ) + ); + + // End the loop. endwhile; ?> diff --git a/themes/twentyfifteen/style.css b/themes/twentyfifteen/style.css index d53b3eb2..49631ce0 100644 --- a/themes/twentyfifteen/style.css +++ b/themes/twentyfifteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfifteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer. -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, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready diff --git a/themes/twentyfourteen/archive.php b/themes/twentyfourteen/archive.php index 6a4deed0..9d2ba95f 100644 --- a/themes/twentyfourteen/archive.php +++ b/themes/twentyfourteen/archive.php @@ -10,7 +10,7 @@ * already has tag.php for Tag archives, category.php for Category archives, * and author.php for Author archives. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -27,8 +27,8 @@ get_header(); ?> <header class="page-header"> <h1 class="page-title"> <?php - if ( is_day() ) : - printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() ); + if ( is_day() ) : + printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) ); @@ -40,20 +40,21 @@ get_header(); ?> _e( 'Archives', 'twentyfourteen' ); endif; - ?> + ?> </h1> </header><!-- .page-header --> - <?php + <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); - /* - * Include the post format-specific template for the content. If you want to - * use this in a child theme, then include a file called content-___.php - * (where ___ is the post format) and that will be used instead. - */ - get_template_part( 'content', get_post_format() ); + /* + * Include the post format-specific template for the content. If you want to + * use this in a child theme, then include a file called content-___.php + * (where ___ is the post format) and that will be used instead. + */ + get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. @@ -64,7 +65,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentyfourteen/author.php b/themes/twentyfourteen/author.php index a40f2090..2f1d47fb 100644 --- a/themes/twentyfourteen/author.php +++ b/themes/twentyfourteen/author.php @@ -2,7 +2,7 @@ /** * The template for displaying Author archive pages * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -36,7 +36,7 @@ get_header(); ?> <?php endif; ?> </header><!-- .archive-header --> - <?php + <?php /* * Since we called the_post() above, we need to rewind * the loop back to the beginning that way we can run @@ -45,14 +45,15 @@ get_header(); ?> rewind_posts(); // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); - /* - * Include the post format-specific template for the content. If you want to - * use this in a child theme, then include a file called content-___.php - * (where ___ is the post format) and that will be used instead. - */ - get_template_part( 'content', get_post_format() ); + /* + * Include the post format-specific template for the content. If you want to + * use this in a child theme, then include a file called content-___.php + * (where ___ is the post format) and that will be used instead. + */ + get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. @@ -63,7 +64,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentyfourteen/category.php b/themes/twentyfourteen/category.php index 97745ff1..c193cc7b 100644 --- a/themes/twentyfourteen/category.php +++ b/themes/twentyfourteen/category.php @@ -2,7 +2,7 @@ /** * The template for displaying Category pages * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -22,21 +22,22 @@ get_header(); ?> <?php // Show an optional term description. $term_description = term_description(); - if ( ! empty( $term_description ) ) : - printf( '<div class="taxonomy-description">%s</div>', $term_description ); + if ( ! empty( $term_description ) ) : + printf( '<div class="taxonomy-description">%s</div>', $term_description ); endif; ?> </header><!-- .archive-header --> - <?php + <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* - * Include the post format-specific template for the content. If you want to - * use this in a child theme, then include a file called content-___.php - * (where ___ is the post format) and that will be used instead. - */ + * Include the post format-specific template for the content. If you want to + * use this in a child theme, then include a file called content-___.php + * (where ___ is the post format) and that will be used instead. + */ get_template_part( 'content', get_post_format() ); endwhile; @@ -48,7 +49,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentyfourteen/comments.php b/themes/twentyfourteen/comments.php index d62e91a7..0b81703f 100644 --- a/themes/twentyfourteen/comments.php +++ b/themes/twentyfourteen/comments.php @@ -25,27 +25,27 @@ if ( post_password_required() ) { <h2 class="comments-title"> <?php $comments_number = get_comments_number(); - if ( '1' === $comments_number ) { - /* translators: %s: post title */ - printf( _x( 'One thought on “%s”', 'comments title', 'twentyfourteen' ), get_the_title() ); - } else { - printf( - /* translators: 1: number of comments, 2: post title */ - _nx( - '%1$s thought on “%2$s”', - '%1$s thoughts on “%2$s”', - $comments_number, - 'comments title', - 'twentyfourteen' - ), - number_format_i18n( $comments_number ), - get_the_title() - ); - } + if ( '1' === $comments_number ) { + /* translators: %s: post title */ + printf( _x( 'One thought on “%s”', 'comments title', 'twentyfourteen' ), get_the_title() ); + } else { + printf( + /* translators: 1: number of comments, 2: post title */ + _nx( + '%1$s thought on “%2$s”', + '%1$s thoughts on “%2$s”', + $comments_number, + 'comments title', + 'twentyfourteen' + ), + number_format_i18n( $comments_number ), + get_the_title() + ); + } ?> </h2> - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> @@ -55,15 +55,17 @@ if ( post_password_required() ) { <ol class="comment-list"> <?php - wp_list_comments( array( - 'style' => 'ol', - 'short_ping' => true, - 'avatar_size' => 34, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 34, + ) + ); ?> </ol><!-- .comment-list --> - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> @@ -71,7 +73,7 @@ if ( post_password_required() ) { </nav><!-- #comment-nav-below --> <?php endif; // Check for comment navigation. ?> - <?php if ( ! comments_open() ) : ?> + <?php if ( ! comments_open() ) : ?> <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p> <?php endif; ?> diff --git a/themes/twentyfourteen/content-aside.php b/themes/twentyfourteen/content-aside.php index 0401579d..3fd3acda 100644 --- a/themes/twentyfourteen/content-aside.php +++ b/themes/twentyfourteen/content-aside.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-audio.php b/themes/twentyfourteen/content-audio.php index 9fa9df41..4dba002a 100644 --- a/themes/twentyfourteen/content-audio.php +++ b/themes/twentyfourteen/content-audio.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-featured-post.php b/themes/twentyfourteen/content-featured-post.php index 6cc88224..d5a16fef 100644 --- a/themes/twentyfourteen/content-featured-post.php +++ b/themes/twentyfourteen/content-featured-post.php @@ -12,12 +12,12 @@ <a class="post-thumbnail" href="<?php the_permalink(); ?>"> <?php // Output the featured image. - if ( has_post_thumbnail() ) : - if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) { - the_post_thumbnail(); - } else { - the_post_thumbnail( 'twentyfourteen-full-width' ); - } + if ( has_post_thumbnail() ) : + if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) { + the_post_thumbnail(); + } else { + the_post_thumbnail( 'twentyfourteen-full-width' ); + } endif; ?> </a> @@ -29,6 +29,6 @@ </div><!-- .entry-meta --> <?php endif; ?> - <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h1>' ); ?> + <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?> </header><!-- .entry-header --> </article><!-- #post-## --> diff --git a/themes/twentyfourteen/content-gallery.php b/themes/twentyfourteen/content-gallery.php index 6e3fe832..9ecdfbf9 100644 --- a/themes/twentyfourteen/content-gallery.php +++ b/themes/twentyfourteen/content-gallery.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-image.php b/themes/twentyfourteen/content-image.php index a81e493d..911ef239 100644 --- a/themes/twentyfourteen/content-image.php +++ b/themes/twentyfourteen/content-image.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-link.php b/themes/twentyfourteen/content-link.php index 858301ef..9ad08102 100644 --- a/themes/twentyfourteen/content-link.php +++ b/themes/twentyfourteen/content-link.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-none.php b/themes/twentyfourteen/content-none.php index a83e06ee..a97f84c8 100644 --- a/themes/twentyfourteen/content-none.php +++ b/themes/twentyfourteen/content-none.php @@ -20,12 +20,12 @@ <?php elseif ( is_search() ) : ?> <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfourteen' ); ?></p> - <?php get_search_form(); ?> + <?php get_search_form(); ?> <?php else : ?> <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentyfourteen' ); ?></p> - <?php get_search_form(); ?> + <?php get_search_form(); ?> <?php endif; ?> </div><!-- .page-content --> diff --git a/themes/twentyfourteen/content-page.php b/themes/twentyfourteen/content-page.php index 98394190..ca8ebd9b 100644 --- a/themes/twentyfourteen/content-page.php +++ b/themes/twentyfourteen/content-page.php @@ -18,14 +18,16 @@ <div class="entry-content"> <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); - ?> + ?> </div><!-- .entry-content --> </article><!-- #post-## --> diff --git a/themes/twentyfourteen/content-quote.php b/themes/twentyfourteen/content-quote.php index 10a5d112..70319087 100644 --- a/themes/twentyfourteen/content-quote.php +++ b/themes/twentyfourteen/content-quote.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content-video.php b/themes/twentyfourteen/content-video.php index 4c49aaa1..c13d6700 100644 --- a/themes/twentyfourteen/content-video.php +++ b/themes/twentyfourteen/content-video.php @@ -16,15 +16,15 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div><!-- .entry-meta --> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <span class="post-format"> @@ -44,18 +44,22 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); - - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); - ?> + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); + ?> </div><!-- .entry-content --> <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?> diff --git a/themes/twentyfourteen/content.php b/themes/twentyfourteen/content.php index e571d8b3..367cf337 100644 --- a/themes/twentyfourteen/content.php +++ b/themes/twentyfourteen/content.php @@ -18,25 +18,26 @@ <div class="entry-meta"> <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span> </div> - <?php + <?php endif; - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); endif; - ?> + ?> <div class="entry-meta"> <?php - if ( 'post' == get_post_type() ) - twentyfourteen_posted_on(); + if ( 'post' == get_post_type() ) { + twentyfourteen_posted_on(); + } - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : - ?> + if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : + ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> - <?php + <?php endif; edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); @@ -52,17 +53,21 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); + the_content( + sprintf( + __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + ) + ); ?> </div><!-- .entry-content --> <?php endif; ?> diff --git a/themes/twentyfourteen/css/blocks.css b/themes/twentyfourteen/css/blocks.css index 425c8dbc..e0f0e231 100644 --- a/themes/twentyfourteen/css/blocks.css +++ b/themes/twentyfourteen/css/blocks.css @@ -139,7 +139,6 @@ p.has-drop-cap:not(:focus)::first-letter { .wp-block-file .wp-block-file__button { background-color: #24890d; border: 0; - border-radius: 2px; color: #fff; font-size: 12px; font-weight: 700; @@ -221,12 +220,11 @@ p.has-drop-cap:not(:focus)::first-letter { /* 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-decoration: none; text-transform: uppercase; vertical-align: bottom; } @@ -236,8 +234,14 @@ p.has-drop-cap:not(:focus)::first-letter { color: #fff; } +.is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #24890d; +} + .wp-block-button__link:hover, -.wp-block-button__link:focus { +.wp-block-button__link:focus, +.is-style-outline .wp-block-button__link:not(.has-text-color):hover, +.is-style-outline .wp-block-button__link:not(.has-text-color):focus { background-color: #41a62a; color: #fff; } diff --git a/themes/twentyfourteen/css/editor-blocks.css b/themes/twentyfourteen/css/editor-blocks.css index e8fba395..079896cb 100644 --- a/themes/twentyfourteen/css/editor-blocks.css +++ b/themes/twentyfourteen/css/editor-blocks.css @@ -389,10 +389,6 @@ p.has-drop-cap:not(:focus)::first-letter { /* 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; @@ -400,6 +396,15 @@ p.has-drop-cap:not(:focus)::first-letter { vertical-align: bottom; } +.wp-block-button__link { + background-color: #24890d; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #24890d; +} + .editor-block-list__block .wp-block-button .mce-content-body { line-height: normal; } diff --git a/themes/twentyfourteen/css/editor-style.css b/themes/twentyfourteen/css/editor-style.css index 6bd5ac0f..4c5482ad 100644 --- a/themes/twentyfourteen/css/editor-style.css +++ b/themes/twentyfourteen/css/editor-style.css @@ -628,7 +628,6 @@ img { box-shadow: 1px 1px 1px rgba(0,0,0,.8); color: #000; height: 36px; - margin-left: -24px; width: 48px; } @@ -637,7 +636,7 @@ img { content: '\f452'; display: inline-block; font: normal 32px/1.125 Genericons; - position: absolute; + position: relative; top: 1px; left: 10px; } diff --git a/themes/twentyfourteen/featured-content.php b/themes/twentyfourteen/featured-content.php index c56edf3e..f9f32dd3 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 066fa385..d1016eb9 100644 --- a/themes/twentyfourteen/footer.php +++ b/themes/twentyfourteen/footer.php @@ -32,4 +32,4 @@ <?php wp_footer(); ?> </body> -</html> \ No newline at end of file +</html> diff --git a/themes/twentyfourteen/functions.php b/themes/twentyfourteen/functions.php index 3babfeb1..e705a546 100644 --- a/themes/twentyfourteen/functions.php +++ b/themes/twentyfourteen/functions.php @@ -44,122 +44,152 @@ 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. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_setup() { - - /* - * Make Twenty Fourteen available for translation. + /** + * Twenty Fourteen setup. * - * 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. + * 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 */ - load_theme_textdomain( 'twentyfourteen' ); + 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' ) ); + + // Load regular editor styles into the new block-based editor. + add_theme_support( 'editor-styles' ); + + // Load default block styles. + add_theme_support( 'wp-block-styles' ); + + // Add support for responsive embeds. + add_theme_support( 'responsive-embeds' ); + + // Add support for custom color scheme. + add_theme_support( + 'editor-color-palette', + array( + array( + 'name' => __( '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', + ), + ) + ); - // 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 <head> for posts and comments. + add_theme_support( 'automatic-feed-links' ); - // Load regular editor styles into the new block-based editor. - add_theme_support( 'editor-styles' ); + // 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 ); - // Load default block styles. - add_theme_support( 'wp-block-styles' ); + // 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' ), + ) + ); - // Add support for responsive embeds. - add_theme_support( 'responsive-embeds' ); + /* + * 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', + ) + ); - // 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 <head> 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' ), - ) ); + /* + * 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', + ) + ); - /* - * 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 allows users to set a custom background. + add_theme_support( + 'custom-background', + apply_filters( + 'twentyfourteen_custom_background_args', + array( + 'default-color' => 'f5f5f5', + ) + ) + ); - /* - * 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' ); -} + // 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' ); @@ -213,33 +243,39 @@ 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' => '<aside id="%1$s" class="widget %2$s">', - 'after_widget' => '</aside>', - 'before_title' => '<h1 class="widget-title">', - 'after_title' => '</h1>', - ) ); - register_sidebar( array( - 'name' => __( 'Content Sidebar', 'twentyfourteen' ), - 'id' => 'sidebar-2', - 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', - 'after_widget' => '</aside>', - 'before_title' => '<h1 class="widget-title">', - 'after_title' => '</h1>', - ) ); - register_sidebar( array( - 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), - 'before_widget' => '<aside id="%1$s" class="widget %2$s">', - 'after_widget' => '</aside>', - 'before_title' => '<h1 class="widget-title">', - 'after_title' => '</h1>', - ) ); + register_sidebar( + array( + 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', + 'after_widget' => '</aside>', + 'before_title' => '<h1 class="widget-title">', + 'after_title' => '</h1>', + ) + ); + register_sidebar( + array( + 'name' => __( 'Content Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', + 'after_widget' => '</aside>', + 'before_title' => '<h1 class="widget-title">', + 'after_title' => '</h1>', + ) + ); + register_sidebar( + array( + 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), + 'before_widget' => '<aside id="%1$s" class="widget %2$s">', + 'after_widget' => '</aside>', + 'before_title' => '<h1 class="widget-title">', + 'after_title' => '</h1>', + ) + ); } add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); @@ -261,7 +297,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; @@ -283,7 +319,7 @@ function twentyfourteen_scripts() { 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' ); + wp_enqueue_style( 'twentyfourteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfourteen-style' ), '20181230' ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131205' ); @@ -303,10 +339,14 @@ 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 ); @@ -355,103 +395,106 @@ add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); */ function twentyfourteen_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentyfourteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' ); + wp_enqueue_style( 'twentyfourteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' ); // 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(); /** - * Filter the default Twenty Fourteen attachment size. + * Print the attached image with a link to the next attached image. * * @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(); + 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', + ) + ); - /* - * 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; + // 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 ); + // get the URL of the next image attachment... + if ( $next_id ) { + $next_attachment_url = get_attachment_link( $next_id ); + } else { + // or get the URL of the first image attachment. + $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); + } } - // or get the URL of the first image attachment. - else { - $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); - } + printf( + '<a href="%1$s" rel="attachment">%2$s</a>', + esc_url( $next_attachment_url ), + wp_get_attachment_image( $post->ID, $attachment_size ) + ); } - - printf( '<a href="%1$s" rel="attachment">%2$s</a>', - 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; + } + ?> - <div class="contributor"> + <div class="contributor"> <div class="contributor-info"> <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div> <div class="contributor-summary"> @@ -466,9 +509,9 @@ function twentyfourteen_list_authors() { </div><!-- .contributor-info --> </div><!-- .contributor --> - <?php + <?php endforeach; -} + } endif; /** @@ -633,9 +676,9 @@ if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow * `is_customize_preview` function was introduced. */ if ( ! function_exists( 'is_customize_preview' ) ) : -function is_customize_preview() { - global $wp_customize; + function is_customize_preview() { + global $wp_customize; - return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->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 7286d889..1de76b34 100644 --- a/themes/twentyfourteen/header.php +++ b/themes/twentyfourteen/header.php @@ -23,7 +23,7 @@ <meta name="viewport" content="width=device-width"> <title><?php wp_title( '|', true, 'right' ); ?> - + @@ -51,7 +51,15 @@ diff --git a/themes/twentyfourteen/image.php b/themes/twentyfourteen/image.php index 83ac67f6..f0af8b83 100644 --- a/themes/twentyfourteen/image.php +++ b/themes/twentyfourteen/image.php @@ -18,45 +18,48 @@ get_header(); -
> -
- ', '' ); ?> + while ( have_posts() ) : + the_post(); + ?> +
-
-
-
- -
+
+
+
+ +
- +
-
+
- '', 'link_before' => '', 'link_after' => '', - ) ); - ?> + ) + ); + ?>
diff --git a/themes/twentyfourteen/inc/back-compat.php b/themes/twentyfourteen/inc/back-compat.php index c184d912..0e8f34b5 100644 --- a/themes/twentyfourteen/inc/back-compat.php +++ b/themes/twentyfourteen/inc/back-compat.php @@ -44,9 +44,13 @@ 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 287b1068..92382eaa 100644 --- a/themes/twentyfourteen/inc/custom-header.php +++ b/themes/twentyfourteen/inc/custom-header.php @@ -35,69 +35,75 @@ 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() { + ?>

-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. @@ -49,31 +55,41 @@ 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' ); @@ -137,16 +153,18 @@ function twentyfourteen_contextual_help() { return; } - get_current_screen()->add_help_tab( array( - 'id' => 'twentyfourteen', - 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), - 'content' => - '', - ) ); + get_current_screen()->add_help_tab( + array( + 'id' => 'twentyfourteen', + 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), + 'content' => + '', + ) + ); } 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 ffeb993d..23fb38d7 100644 --- a/themes/twentyfourteen/inc/featured-content.php +++ b/themes/twentyfourteen/inc/featured-content.php @@ -23,8 +23,6 @@ class Featured_Content { * * @since Twenty Fourteen 1.0 * - * @static - * @access public * @var int */ public static $max_posts = 15; @@ -34,8 +32,6 @@ 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() { @@ -51,8 +47,6 @@ 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() { @@ -83,15 +77,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' ) ); } /** @@ -100,13 +94,11 @@ 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 ); } } @@ -114,8 +106,6 @@ class Featured_Content { /** * Get featured posts. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @return array Array of featured posts. @@ -128,10 +118,12 @@ 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; } @@ -144,8 +136,6 @@ class Featured_Content { * * Sets the "featured_content_ids" transient. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @return array Array of post IDs. @@ -160,18 +150,20 @@ 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. @@ -189,8 +181,6 @@ 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. @@ -206,8 +196,6 @@ class Featured_Content { * * @see Featured_Content::validate_settings(). * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function delete_transient() { @@ -221,8 +209,6 @@ 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. @@ -269,8 +255,6 @@ 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. @@ -283,7 +267,7 @@ class Featured_Content { } $settings['tag-id'] = 0; - $settings = self::validate_settings( $settings ); + $settings = self::validate_settings( $settings ); update_option( 'featured-content', $settings ); } @@ -292,8 +276,6 @@ 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(). @@ -340,8 +322,6 @@ 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(). @@ -381,8 +361,6 @@ class Featured_Content { /** * Register custom setting on the Settings -> Reading screen. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function register_setting() { @@ -392,54 +370,66 @@ 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() { @@ -458,8 +448,6 @@ 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. @@ -491,8 +479,6 @@ 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 1d35d0d5..15003864 100644 --- a/themes/twentyfourteen/inc/template-tags.php +++ b/themes/twentyfourteen/inc/template-tags.php @@ -8,116 +8,119 @@ */ 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; - } - - $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 ); - - if ( isset( $url_parts[1] ) ) { - wp_parse_str( $url_parts[1], $query_args ); - } + /** + * 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; + } - $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); - $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; + $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 ); - $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 ( isset( $url_parts[1] ) ) { + wp_parse_str( $url_parts[1], $query_args ); + } - // 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' ), - ) ); + $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 ( $links ) : + if ( $links ) : - ?> -