diff options
author | 2019-04-28 18:30:29 -0400 | |
---|---|---|
committer | 2019-04-28 18:30:29 -0400 | |
commit | 4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e (patch) | |
tree | 171fddc56d74d8492ffb703f04543896b6344243 | |
parent | Updating packages for 5.1.1 (diff) | |
download | blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.tar.gz blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.tar.bz2 blogs-gentoo-4ef1e1c47c509ea8ca1f194fcfb9ce816c01f29e.zip |
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 <blueknight@gentoo.org>
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:<?php echo esc_attr( $mantra_footercolor ); ?>; }<?php }
if ($mantra_titlecolor != "0D85CC") { ?> #site-title span a { color:<?php echo esc_attr( $mantra_titlecolor ); ?>; }<?php }
if ($mantra_descriptioncolor != "0D85CC") { ?> #site-description { color:<?php echo esc_attr( $mantra_descriptioncolor ); ?>; }<?php }
- if ($mantra_contentcolor != "333333") { ?> #content, #content p, #content ul, #content ol { color:<?php echo esc_attr( $mantra_contentcolor ); ?> ;}<?php }
+ if ($mantra_contentcolor != "333333") { ?> #content { color:<?php echo esc_attr( $mantra_contentcolor ); ?> ;}<?php }
if ($mantra_linkscolor != "0D85CC") { ?> .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:<?php echo esc_attr( $mantra_linkscolor ); ?>; }<?php }
@@ -188,10 +188,10 @@ function mantra_custom_styles() { if ($mantra_sideheadbackcolor != "444444") { ?> .widget-title { background-color:<?php echo esc_attr( $mantra_sideheadbackcolor ); ?>; }<?php }
if ($mantra_sideheadtextcolor != "2EA5FD") { ?> .widget-title { color:<?php echo esc_attr( $mantra_sideheadtextcolor ); ?>; }<?php }
- if ($mantra_magazinelayout == "Enable") { ?> #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; } <?php } ?>
+ #content article:nth-of-type(2n) {clear: right; margin-right: 0;} <?php } ?>
#footer-widget-area .widget-title { color:<?php echo esc_attr( $mantra_footerheader ); ?>; }
#footer-widget-area a { color:<?php echo esc_attr( $mantra_footertext ); ?>; }
@@ -215,7 +215,7 @@ function mantra_custom_styles() { if ($mantra_postcateg == "Hide") { ?> .entry-meta span.bl_categ, .entry-meta2 span.bl_categ { display:none; } <?php }
if ($mantra_posttag == "Hide") { ?> .entry-utility span.bl_posted, .entry-meta2 span.bl_tagg,.entry-meta3 span.bl_tagg { display:none; } <?php }
if ($mantra_postbook == "Hide") { ?> .entry-utility span.bl_bookmark { display:none; } <?php }
- if ($mantra_parmargin) { ?> #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:<?php echo esc_attr( $mantra_parmargin ); ?>;} <?php }
if ($mantra_parindent != "0px") { ?> p {text-indent: <?php echo esc_attr( $mantra_parindent );?>; } <?php }
if ($mantra_posttime == "Hide") { ?> .entry-meta .entry-time { display:none; } <?php }
diff --git a/themes/mantra/includes/theme-frontpage.php b/themes/mantra/includes/theme-frontpage.php index aaba9bbb..a730d6b6 100644 --- a/themes/mantra/includes/theme-frontpage.php +++ b/themes/mantra/includes/theme-frontpage.php @@ -167,8 +167,8 @@ function mantra_frontpage_generator() { <?php } // columns // Frontpage text areas - if (!empty($mantra_fronttext3)) {?><div id="front-text3" class="front-text"><?php echo do_shortcode( $mantra_fronttext3 ) ?></div><?php } - if (!empty($mantra_fronttext4)) {?><div id="front-text4" class="front-text"><?php echo do_shortcode( $mantra_fronttext4 ) ?></div><?php } + if (!empty($mantra_fronttext3)) {?><div id="front-text3" class="front-text"><?php echo do_shortcode( force_balance_tags( $mantra_fronttext3 ) ) ?></div><?php } + if (!empty($mantra_fronttext4)) {?><div id="front-text4" class="front-text"><?php echo do_shortcode( force_balance_tags( $mantra_fronttext4 ) ) ?></div><?php } ?> </div> <!-- frontpage --> 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(); ?> <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /* * Include the Post-Format-specific template for the content. @@ -41,17 +42,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/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() ) { <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', 'twentyfifteen' ), 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', - 'twentyfifteen' - ), - number_format_i18n( $comments_number ), - get_the_title() - ); - } + if ( '1' === $comments_number ) { + /* translators: %s: post title */ + printf( _x( 'One thought on “%s”', 'comments title', 'twentyfifteen' ), 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', + 'twentyfifteen' + ), + number_format_i18n( $comments_number ), + get_the_title() + ); + } ?> </h2> @@ -50,11 +50,13 @@ if ( post_password_required() ) { <ol class="comment-list"> <?php - wp_list_comments( array( - 'style' => 'ol', - 'short_ping' => true, - 'avatar_size' => 56, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 56, + ) + ); ?> </ol><!-- .comment-list --> @@ -64,9 +66,9 @@ if ( post_password_required() ) { <?php // If comments are closed and there are comments, let's leave a little note, shall we? - if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : - ?> - <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> + if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : + ?> + <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> <?php endif; ?> <?php comment_form(); ?> 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 @@ <header class="entry-header"> <?php - if ( is_single() ) : - the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' ); + if ( is_single() ) : + the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' ); else : the_title( sprintf( '<h2 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h2>' ); endif; - ?> + ?> </header> <!-- .entry-header --> <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s', 'twentyfifteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); + the_content( + sprintf( + __( 'Continue reading %s', 'twentyfifteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); - 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>', - ) ); - ?> + 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 --> <?php // Author bio. - if ( is_single() && get_the_author_meta( 'description' ) ) : - get_template_part( 'author-bio' ); + if ( is_single() && get_the_author_meta( 'description' ) ) : + get_template_part( 'author-bio' ); endif; ?> 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 @@ <div class="entry-content"> <?php the_content(); ?> <?php - 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>', - ) ); - ?> + 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 --> <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?> 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 @@ <header class="entry-header"> <?php - if ( is_single() ) : - the_title( '<h1 class="entry-title">', '</h1>' ); + if ( is_single() ) : + the_title( '<h1 class="entry-title">', '</h1>' ); else : the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); endif; - ?> + ?> </header><!-- .entry-header --> <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading %s', 'twentyfifteen' ), - the_title( '<span class="screen-reader-text">', '</span>', false ) - ) ); + the_content( + sprintf( + __( 'Continue reading %s', 'twentyfifteen' ), + the_title( '<span class="screen-reader-text">', '</span>', false ) + ) + ); - 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>', - ) ); - ?> + 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 --> <?php // Author bio. - if ( is_single() && get_the_author_meta( 'description' ) ) : - get_template_part( 'author-bio' ); + if ( is_single() && get_the_author_meta( 'description' ) ) : + get_template_part( 'author-bio' ); endif; ?> 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 <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. + * 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' ); ?></title> <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 get_template_directory_uri(); ?>/js/html5.js"></script> <![endif]--> @@ -51,7 +51,15 @@ <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> <button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button> <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a> - <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu' ) ); ?> + <?php + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'menu_class' => 'nav-menu', + 'menu_id' => 'primary-menu', + ) + ); + ?> </nav> </div> 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(); <?php // Start the Loop. - while ( have_posts() ) : the_post(); - ?> - <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> - <header class="entry-header"> - <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> + while ( have_posts() ) : + the_post(); + ?> + <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> + <header class="entry-header"> + <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> - <div class="entry-meta"> + <div class="entry-meta"> - <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span> + <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span> - <span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> × <?php echo esc_html( $metadata['height'] ); ?></a></span> + <span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> × <?php echo esc_html( $metadata['height'] ); ?></a></span> - <span class="parent-post-link"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span> - <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> - </div><!-- .entry-meta --> - </header><!-- .entry-header --> + <span class="parent-post-link"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span> + <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> + </div><!-- .entry-meta --> + </header><!-- .entry-header --> - <div class="entry-content"> - <div class="entry-attachment"> - <div class="attachment"> - <?php twentyfourteen_the_attached_image(); ?> - </div><!-- .attachment --> + <div class="entry-content"> + <div class="entry-attachment"> + <div class="attachment"> + <?php twentyfourteen_the_attached_image(); ?> + </div><!-- .attachment --> - <?php if ( has_excerpt() ) : ?> + <?php if ( has_excerpt() ) : ?> <div class="entry-caption"> <?php the_excerpt(); ?> </div><!-- .entry-caption --> <?php endif; ?> - </div><!-- .entry-attachment --> + </div><!-- .entry-attachment --> - <?php - the_content(); - wp_link_pages( array( + <?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>', - ) ); - ?> + ) + ); + ?> </div><!-- .entry-content --> </article><!-- #post-## --> 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. - ?> - <style type="text/css" id="twentyfourteen-header-css"> - <?php + // If we get this far, we have custom styles. + ?> + <style type="text/css" id="twentyfourteen-header-css"> + <?php // Has the text been hidden? if ( ! display_header_text() ) : - ?> + ?> .site-title, .site-description { clip: rect(1px 1px 1px 1px); /* IE7 */ clip: rect(1px, 1px, 1px, 1px); position: absolute; } - <?php - // If the user has set a custom color for the text, use that. + <?php + // If the user has set a custom color for the text, use that. elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) : - ?> + ?> .site-title a { color: #<?php echo esc_attr( $text_color ); ?>; } <?php endif; ?> </style> - <?php -} + <?php + } endif; // twentyfourteen_header_style if ( ! function_exists( '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() { -?> + /** + * 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() { + ?> <style type="text/css" id="twentyfourteen-admin-header-css"> .appearance_page_custom-header #headimg { background-color: #000; @@ -122,26 +128,26 @@ function twentyfourteen_admin_header_style() { vertical-align: middle; } </style> -<?php -} + <?php + } endif; // twentyfourteen_admin_header_style if ( ! function_exists( '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() { -?> + /** + * 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() { + ?> <div id="headimg"> <?php if ( get_header_image() ) : ?> <img src="<?php header_image(); ?>" alt=""> <?php endif; ?> <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( sprintf( 'color: #%s;', get_header_textcolor() ) ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> </div> -<?php -} + <?php + } endif; // twentyfourteen_admin_header_image diff --git a/themes/twentyfourteen/inc/customizer.php b/themes/twentyfourteen/inc/customizer.php index 39289159..15314093 100644 --- a/themes/twentyfourteen/inc/customizer.php +++ b/themes/twentyfourteen/inc/customizer.php @@ -16,21 +16,27 @@ */ function twentyfourteen_customize_register( $wp_customize ) { // Add postMessage support for site title and description. - $wp_customize->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 <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> 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 <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> 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' => - '<ul>' . - '<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance → Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' . - '<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' . - '<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' . - '</ul>', - ) ); + get_current_screen()->add_help_tab( + array( + 'id' => 'twentyfourteen', + 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), + 'content' => + '<ul>' . + '<li>' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance → Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '</li>' . + '<li>' . sprintf( __( 'Enhance your site design by using <a href="%s">Featured Images</a> for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '</li>' . + '<li>' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '</li>' . + '</ul>', + ) + ); } 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 <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> 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 <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> 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 ) : - ?> - <nav class="navigation paging-navigation" role="navigation"> + ?> + <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentyfourteen' ); ?></h1> <div class="pagination loop-pagination"> <?php echo $links; ?> </div><!-- .pagination --> </nav><!-- .navigation --> - <?php + <?php endif; -} + } endif; if ( ! function_exists( 'twentyfourteen_post_nav' ) ) : -/** - * Display navigation to next/previous post when applicable. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_post_nav() { - // Don't print empty markup if there's nowhere to navigate. - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); - $next = get_adjacent_post( false, '', false ); - - if ( ! $next && ! $previous ) { - return; - } + /** + * Display navigation to next/previous post when applicable. + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_post_nav() { + // Don't print empty markup if there's nowhere to navigate. + $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); + $next = get_adjacent_post( false, '', false ); + + if ( ! $next && ! $previous ) { + return; + } - ?> - <nav class="navigation post-navigation" role="navigation"> + ?> + <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1> <div class="nav-links"> <?php if ( is_attachment() ) : previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) ); - else : - previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); - next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); - endif; - ?> - </div><!-- .nav-links --> - </nav><!-- .navigation --> - <?php -} + else : + previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); + next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); + endif; + ?> + </div><!-- .nav-links --> + </nav><!-- .navigation --> + <?php + } endif; if ( ! function_exists( 'twentyfourteen_posted_on' ) ) : -/** - * Print HTML with meta information for the current post-date/time and author. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_posted_on() { - if ( is_sticky() && is_home() && ! is_paged() ) { - echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>'; - } + /** + * Print HTML with meta information for the current post-date/time and author. + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_posted_on() { + if ( is_sticky() && is_home() && ! is_paged() ) { + echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>'; + } - // Set up and print post meta information. - printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', - esc_url( get_permalink() ), - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); -} + // Set up and print post meta information. + printf( + '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', + esc_url( get_permalink() ), + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } endif; /** @@ -130,9 +133,11 @@ endif; function twentyfourteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { // Create an array of all the categories that are attached to posts - $all_the_cool_cats = get_categories( array( - 'hide_empty' => 1, - ) ); + $all_the_cool_cats = get_categories( + array( + 'hide_empty' => 1, + ) + ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); @@ -159,69 +164,71 @@ function twentyfourteen_category_transient_flusher() { delete_transient( 'twentyfourteen_category_count' ); } add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); -add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); +add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) : -/** - * Display an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index - * views, or a div element when on single views. - * - * @since Twenty Fourteen 1.0 - * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. - */ -function twentyfourteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Display an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index + * views, or a div element when on single views. + * + * @since Twenty Fourteen 1.0 + * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. + */ + function twentyfourteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> - <div class="post-thumbnail"> - <?php - if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { - the_post_thumbnail( 'twentyfourteen-full-width' ); - } else { - the_post_thumbnail(); - } - ?> - </div> + <div class="post-thumbnail"> + <?php + if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { + the_post_thumbnail( 'twentyfourteen-full-width' ); + } else { + the_post_thumbnail(); + } + ?> + </div> - <?php else : ?> + <?php else : ?> <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> - <?php - if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { - the_post_thumbnail( 'twentyfourteen-full-width' ); - } else { - the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); - } - ?> + <?php + if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { + the_post_thumbnail( 'twentyfourteen-full-width' ); + } else { + the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); + } + ?> </a> - <?php endif; // End is_singular() -} + <?php + endif; // End is_singular() + } endif; if ( ! function_exists( 'twentyfourteen_excerpt_more' ) && ! is_admin() ) : -/** - * Replaces "[...]" (appended to automatically generated excerpts) with ... - * and a Continue reading link. - * - * @since Twenty Fourteen 1.3 - * - * @param string $more Default Read More excerpt link. - * @return string Filtered Read More excerpt link. - */ -function twentyfourteen_excerpt_more( $more ) { - $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', - esc_url( get_permalink( get_the_ID() ) ), + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... + * and a Continue reading link. + * + * @since Twenty Fourteen 1.3 + * + * @param string $more Default Read More excerpt link. + * @return string Filtered Read More excerpt link. + */ + function twentyfourteen_excerpt_more( $more ) { + $link = sprintf( + '<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 <span class="meta-nav">→</span>', 'twentyfourteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); endif; diff --git a/themes/twentyfourteen/inc/widgets.php b/themes/twentyfourteen/inc/widgets.php index 533f34a5..7ddabec3 100644 --- a/themes/twentyfourteen/inc/widgets.php +++ b/themes/twentyfourteen/inc/widgets.php @@ -16,7 +16,6 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * The supported post formats. * - * @access private * @since Twenty Fourteen 1.0 * * @var array @@ -31,11 +30,15 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * @return Twenty_Fourteen_Ephemera_Widget */ public function __construct() { - parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( - 'classname' => 'widget_twentyfourteen_ephemera', - 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), - 'customize_selective_refresh' => true, - ) ); + parent::__construct( + 'widget_twentyfourteen_ephemera', + __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), + array( + 'classname' => 'widget_twentyfourteen_ephemera', + 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), + 'customize_selective_refresh' => true, + ) + ); if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); @@ -62,7 +65,6 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * Output the HTML for this widget. * - * @access public * @since Twenty Fourteen 1.0 * * @param array $args An array of standard parameters for widgets in this theme. @@ -106,24 +108,26 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); - $ephemera = new WP_Query( array( - 'order' => 'DESC', - 'posts_per_page' => $number, - 'no_found_rows' => true, - 'post_status' => 'publish', - 'post__not_in' => get_option( 'sticky_posts' ), - 'tax_query' => array( - array( - 'taxonomy' => 'post_format', - 'terms' => array( "post-format-$format" ), - 'field' => 'slug', - 'operator' => 'IN', + $ephemera = new WP_Query( + array( + 'order' => 'DESC', + 'posts_per_page' => $number, + 'no_found_rows' => true, + 'post_status' => 'publish', + 'post__not_in' => get_option( 'sticky_posts' ), + 'tax_query' => array( + array( + 'taxonomy' => 'post_format', + 'terms' => array( "post-format-$format" ), + 'field' => 'slug', + 'operator' => 'IN', + ), ), - ), - ) ); + ) + ); if ( $ephemera->have_posts() ) : - $tmp_content_width = $GLOBALS['content_width']; + $tmp_content_width = $GLOBALS['content_width']; $GLOBALS['content_width'] = 306; echo $args['before_widget']; @@ -134,84 +138,89 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { <ol> <?php - while ( $ephemera->have_posts() ) : - $ephemera->the_post(); - $tmp_more = $GLOBALS['more']; - $GLOBALS['more'] = 0; - ?> + while ( $ephemera->have_posts() ) : + $ephemera->the_post(); + $tmp_more = $GLOBALS['more']; + $GLOBALS['more'] = 0; + ?> <li> <article <?php post_class(); ?>> - <div class="entry-content"> - <?php - if ( has_post_format( 'gallery' ) ) : - - if ( post_password_required() ) : - the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); - else : - $images = array(); - - $galleries = get_post_galleries( get_the_ID(), false ); - if ( isset( $galleries[0]['ids'] ) ) - $images = explode( ',', $galleries[0]['ids'] ); - - if ( ! $images ) : - $images = get_posts( array( - 'fields' => 'ids', - 'numberposts' => -1, - 'order' => 'ASC', - 'orderby' => 'menu_order', + <div class="entry-content"> + <?php + if ( has_post_format( 'gallery' ) ) : + + if ( post_password_required() ) : + the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); + else : + $images = array(); + + $galleries = get_post_galleries( get_the_ID(), false ); + if ( isset( $galleries[0]['ids'] ) ) { + $images = explode( ',', $galleries[0]['ids'] ); + } + + if ( ! $images ) : + $images = get_posts( + array( + 'fields' => 'ids', + 'numberposts' => -1, + 'order' => 'ASC', + 'orderby' => 'menu_order', 'post_mime_type' => 'image', - 'post_parent' => get_the_ID(), - 'post_type' => 'attachment', - ) ); - endif; + 'post_parent' => get_the_ID(), + 'post_type' => 'attachment', + ) + ); + endif; - $total_images = count( $images ); + $total_images = count( $images ); - if ( has_post_thumbnail() ) : - $post_thumbnail = get_the_post_thumbnail(); + if ( has_post_thumbnail() ) : + $post_thumbnail = get_the_post_thumbnail(); elseif ( $total_images > 0 ) : $image = reset( $images ); $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); endif; - if ( ! empty ( $post_thumbnail ) ) : - ?> + if ( ! empty( $post_thumbnail ) ) : + ?> <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a> <?php endif; ?> <p class="wp-caption-text"> - <?php - printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ), + <?php + printf( + _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ), esc_url( get_permalink() ), number_format_i18n( $total_images ) ); - ?> + ?> </p> - <?php - endif; + <?php + endif; else : the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); endif; - ?> + ?> </div><!-- .entry-content --> <header class="entry-header"> <div class="entry-meta"> - <?php - if ( ! has_post_format( 'link' ) ) : - the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); - endif; + <?php + if ( ! has_post_format( 'link' ) ) : + the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); + endif; - printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', - esc_url( get_permalink() ), - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); + printf( + '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', + esc_url( get_permalink() ), + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); - 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 endif; ?> diff --git a/themes/twentyfourteen/index.php b/themes/twentyfourteen/index.php index 3f46be21..7f6d04a0 100644 --- a/themes/twentyfourteen/index.php +++ b/themes/twentyfourteen/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. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -19,37 +19,38 @@ get_header(); ?> <div id="main-content" class="main-content"> <?php - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { - // Include the featured content template. - get_template_part( 'featured-content' ); - } +if ( is_front_page() && twentyfourteen_has_featured_posts() ) { + // Include the featured content template. + get_template_part( 'featured-content' ); +} ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php - if ( have_posts() ) : - // Start the Loop. - 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() ); + if ( have_posts() ) : + // Start the Loop. + 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() ); endwhile; - // Previous/next post navigation. - twentyfourteen_paging_nav(); + // Previous/next post navigation. + twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </div><!-- #primary --> diff --git a/themes/twentyfourteen/js/functions.js b/themes/twentyfourteen/js/functions.js index a21849ec..ac4629d7 100644 --- a/themes/twentyfourteen/js/functions.js +++ b/themes/twentyfourteen/js/functions.js @@ -122,7 +122,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 Fourteen 1.4 diff --git a/themes/twentyfourteen/page-templates/contributors.php b/themes/twentyfourteen/page-templates/contributors.php index 92602ab1..6b1d19db 100644 --- a/themes/twentyfourteen/page-templates/contributors.php +++ b/themes/twentyfourteen/page-templates/contributors.php @@ -12,35 +12,36 @@ get_header(); ?> <div id="main-content" class="main-content"> <?php - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { - // Include the featured content template. - get_template_part( 'featured-content' ); - } +if ( is_front_page() && twentyfourteen_has_featured_posts() ) { + // Include the featured content template. + get_template_part( 'featured-content' ); +} ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. - while ( have_posts() ) : the_post(); - ?> + while ( have_posts() ) : + the_post(); + ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php - the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); + the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); - // Output the authors list. - twentyfourteen_list_authors(); + // Output the authors list. + twentyfourteen_list_authors(); - edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); + edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></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(); - } + <?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(); + } endwhile; ?> </div><!-- #content --> diff --git a/themes/twentyfourteen/page-templates/full-width.php b/themes/twentyfourteen/page-templates/full-width.php index 8830c870..ea5fa588 100644 --- a/themes/twentyfourteen/page-templates/full-width.php +++ b/themes/twentyfourteen/page-templates/full-width.php @@ -12,25 +12,26 @@ get_header(); ?> <div id="main-content" class="main-content"> <?php - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { - // Include the featured content template. - get_template_part( 'featured-content' ); - } +if ( is_front_page() && twentyfourteen_has_featured_posts() ) { + // Include the featured content template. + get_template_part( 'featured-content' ); +} ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); - // Include the page content template. - get_template_part( 'content', 'page' ); + // Include the page content template. + get_template_part( 'content', 'page' ); - // 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(); + } endwhile; ?> </div><!-- #content --> diff --git a/themes/twentyfourteen/page.php b/themes/twentyfourteen/page.php index 44724e94..bd033aeb 100644 --- a/themes/twentyfourteen/page.php +++ b/themes/twentyfourteen/page.php @@ -16,25 +16,26 @@ get_header(); ?> <div id="main-content" class="main-content"> <?php - if ( is_front_page() && twentyfourteen_has_featured_posts() ) { - // Include the featured content template. - get_template_part( 'featured-content' ); - } +if ( is_front_page() && twentyfourteen_has_featured_posts() ) { + // Include the featured content template. + get_template_part( 'featured-content' ); +} ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); - // Include the page content template. - get_template_part( 'content', 'page' ); + // Include the page content template. + get_template_part( 'content', 'page' ); - // 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(); + } endwhile; ?> diff --git a/themes/twentyfourteen/readme.txt b/themes/twentyfourteen/readme.txt index 69d4e653..6f1010d2 100644 --- a/themes/twentyfourteen/readme.txt +++ b/themes/twentyfourteen/readme.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 3.6 Tested up to: WordPress 5.0 -Stable tag: 2.4 +Stable tag: 2.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready @@ -50,6 +50,16 @@ Source: http://www.genericons.com == Changelog == += 2.6 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.6 + += 2.5 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.5 + = 2.4 = * Released: December 19, 2018 diff --git a/themes/twentyfourteen/search.php b/themes/twentyfourteen/search.php index d90d88a1..6b20315a 100644 --- a/themes/twentyfourteen/search.php +++ b/themes/twentyfourteen/search.php @@ -20,14 +20,15 @@ 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 - * 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 post navigation. @@ -38,7 +39,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentyfourteen/sidebar.php b/themes/twentyfourteen/sidebar.php index be3c8e02..60800ffe 100644 --- a/themes/twentyfourteen/sidebar.php +++ b/themes/twentyfourteen/sidebar.php @@ -10,8 +10,8 @@ <div id="secondary"> <?php $description = get_bloginfo( 'description', 'display' ); - if ( ! empty ( $description ) ) : - ?> + if ( ! empty( $description ) ) : + ?> <h2 class="site-description"><?php echo esc_html( $description ); ?></h2> <?php endif; ?> diff --git a/themes/twentyfourteen/single.php b/themes/twentyfourteen/single.php index e089165e..1940c732 100644 --- a/themes/twentyfourteen/single.php +++ b/themes/twentyfourteen/single.php @@ -13,22 +13,23 @@ get_header(); ?> <div id="content" class="site-content" role="main"> <?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() ); - // Previous/next post navigation. - twentyfourteen_post_nav(); + // Previous/next post navigation. + twentyfourteen_post_nav(); - // 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(); + } endwhile; ?> </div><!-- #content --> diff --git a/themes/twentyfourteen/style.css b/themes/twentyfourteen/style.css index 162d2375..94ce71b3 100644 --- a/themes/twentyfourteen/style.css +++ b/themes/twentyfourteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfourteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier. -Version: 2.4 +Version: 2.6 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready @@ -1405,7 +1405,6 @@ a.post-thumbnail:hover { box-shadow: 1px 1px 1px rgba(0,0,0,.8); color: #000; height: 36px; - margin: -28px 0 0 -24px; /* Keep centered on video (container includes visible controls bar) */ width: 48px; } @@ -1415,7 +1414,7 @@ a.post-thumbnail:hover { content: '\f452'; display: inline-block; font: normal 32px/1.125 Genericons; - position: absolute; + position: relative; top: 1px; left: 10px; } diff --git a/themes/twentyfourteen/tag.php b/themes/twentyfourteen/tag.php index 5930d2cf..3a3a3c5e 100644 --- a/themes/twentyfourteen/tag.php +++ b/themes/twentyfourteen/tag.php @@ -4,7 +4,7 @@ * * Used to display archive-type pages for posts in a tag. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -24,22 +24,23 @@ 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. - */ - 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. @@ -50,7 +51,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentyfourteen/taxonomy-post_format.php b/themes/twentyfourteen/taxonomy-post_format.php index f7cee9f7..243e8f0c 100644 --- a/themes/twentyfourteen/taxonomy-post_format.php +++ b/themes/twentyfourteen/taxonomy-post_format.php @@ -9,7 +9,7 @@ * @todo https://core.trac.wordpress.org/ticket/23257: Add plural versions of Post Format strings * and remove plurals below. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Fourteen @@ -26,8 +26,8 @@ get_header(); ?> <header class="archive-header"> <h1 class="archive-title"> <?php - if ( is_tax( 'post_format', 'post-format-aside' ) ) : - _e( 'Asides', 'twentyfourteen' ); + if ( is_tax( 'post_format', 'post-format-aside' ) ) : + _e( 'Asides', 'twentyfourteen' ); elseif ( is_tax( 'post_format', 'post-format-image' ) ) : _e( 'Images', 'twentyfourteen' ); @@ -51,20 +51,21 @@ get_header(); ?> _e( 'Archives', 'twentyfourteen' ); endif; - ?> + ?> </h1> </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. - */ - 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. @@ -75,7 +76,7 @@ get_header(); ?> get_template_part( 'content', 'none' ); endif; - ?> + ?> </div><!-- #content --> </section><!-- #primary --> diff --git a/themes/twentysixteen/archive.php b/themes/twentysixteen/archive.php index bdd2967e..079730f3 100644 --- a/themes/twentysixteen/archive.php +++ b/themes/twentysixteen/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_Sixteen @@ -32,7 +32,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. @@ -41,17 +42,19 @@ get_header(); ?> */ get_template_part( 'template-parts/content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/comments.php b/themes/twentysixteen/comments.php index 7ff5b32d..a0a29d57 100644 --- a/themes/twentysixteen/comments.php +++ b/themes/twentysixteen/comments.php @@ -26,23 +26,23 @@ 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', 'twentysixteen' ), 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', - 'twentysixteen' - ), - number_format_i18n( $comments_number ), - get_the_title() - ); - } + if ( '1' === $comments_number ) { + /* translators: %s: post title */ + printf( _x( 'One thought on “%s”', 'comments title', 'twentysixteen' ), 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', + 'twentysixteen' + ), + number_format_i18n( $comments_number ), + get_the_title() + ); + } ?> </h2> @@ -50,11 +50,13 @@ if ( post_password_required() ) { <ol class="comment-list"> <?php - wp_list_comments( array( - 'style' => 'ol', - 'short_ping' => true, - 'avatar_size' => 42, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 42, + ) + ); ?> </ol><!-- .comment-list --> @@ -64,16 +66,18 @@ if ( post_password_required() ) { <?php // If comments are closed and there are comments, let's leave a little note, shall we? - if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : - ?> - <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> + if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : + ?> + <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> <?php endif; ?> <?php - comment_form( array( - 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', - 'title_reply_after' => '</h2>', - ) ); - ?> + comment_form( + array( + 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', + 'title_reply_after' => '</h2>', + ) + ); + ?> </div><!-- .comments-area --> diff --git a/themes/twentysixteen/css/blocks.css b/themes/twentysixteen/css/blocks.css index ae742241..9ddea807 100644 --- a/themes/twentysixteen/css/blocks.css +++ b/themes/twentysixteen/css/blocks.css @@ -232,13 +232,12 @@ p.has-drop-cap:not(:focus)::first-letter { /* Buttons */ .wp-block-button .wp-block-button__link { - border: 0; - border-radius: 2px; + box-shadow: none; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: 700; letter-spacing: 0.046875em; line-height: 1; - padding: 0.84375em 0.875em 0.78125em; + padding: 0.84375em 1.3125em 0.78125em; text-transform: uppercase; } @@ -247,8 +246,20 @@ p.has-drop-cap:not(:focus)::first-letter { color: #fff; } +.entry-content .is-style-outline .wp-block-button__link:not(.has-background) { + background: transparent; +} + +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) { + color: #1a1a1a; +} + .entry-content .wp-block-button__link:hover, -.entry-content .wp-block-button__link:focus { +.entry-content .wp-block-button__link:focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):hover, +.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):focus { background: #007acc; color: #fff; } diff --git a/themes/twentysixteen/css/editor-blocks.css b/themes/twentysixteen/css/editor-blocks.css index 802353bf..4bf8cbf5 100644 --- a/themes/twentysixteen/css/editor-blocks.css +++ b/themes/twentysixteen/css/editor-blocks.css @@ -543,18 +543,23 @@ Description: Used to style blocks in the editor. /* Buttons */ .wp-block-button .wp-block-button__link { - background: #1a1a1a; - border: 0; - border-radius: 2px; - color: #fff; font-family: Montserrat, "Helvetica Neue", sans-serif; font-weight: 700; letter-spacing: 0.046875em; line-height: 1; - padding: 0.84375em 0.875em 0.78125em; + padding: 0.84375em 1.3125em 0.78125em; text-transform: uppercase; } +.wp-block-button__link { + background: #1a1a1a; + color: #fff; +} + +.is-style-outline .wp-block-button__link { + color: #1a1a1a; +} + /* Media & Text */ .wp-block-media-text *:last-child { diff --git a/themes/twentysixteen/footer.php b/themes/twentysixteen/footer.php index baa82092..5fff3bd9 100644 --- a/themes/twentysixteen/footer.php +++ b/themes/twentysixteen/footer.php @@ -16,10 +16,12 @@ <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'primary', - 'menu_class' => 'primary-menu', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'menu_class' => 'primary-menu', + ) + ); ?> </nav><!-- .main-navigation --> <?php endif; ?> @@ -27,13 +29,15 @@ <?php if ( has_nav_menu( 'social' ) ) : ?> <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'social', - 'menu_class' => 'social-links-menu', - 'depth' => 1, - 'link_before' => '<span class="screen-reader-text">', - 'link_after' => '</span>', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'menu_class' => 'social-links-menu', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>', + ) + ); ?> </nav><!-- .social-navigation --> <?php endif; ?> diff --git a/themes/twentysixteen/functions.php b/themes/twentysixteen/functions.php index 1bade4ca..2c47a2d2 100644 --- a/themes/twentysixteen/functions.php +++ b/themes/twentysixteen/functions.php @@ -33,173 +33,187 @@ if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) { } if ( ! function_exists( 'twentysixteen_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. - * - * Create your own twentysixteen_setup() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_setup() { - /* - * Make theme available for translation. - * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen - * If you're building a theme based on Twenty Sixteen, use a find and replace - * to change 'twentysixteen' to the name of your theme in all the template files - */ - load_theme_textdomain( 'twentysixteen' ); - - // 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 custom logo. + /** + * Sets up theme defaults and registers support for various WordPress features. * - * @since Twenty Sixteen 1.2 - */ - add_theme_support( 'custom-logo', array( - 'height' => 240, - 'width' => 240, - 'flex-height' => true, - ) ); - - /* - * Enable support for Post Thumbnails on posts and pages. + * 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. * - * @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails - */ - add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 1200, 9999 ); - - // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'primary' => __( 'Primary Menu', 'twentysixteen' ), - 'social' => __( 'Social Links Menu', 'twentysixteen' ), - ) ); - - /* - * 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. + * Create your own twentysixteen_setup() function to override in a child theme. * - * See: https://codex.wordpress.org/Post_Formats - */ - add_theme_support( 'post-formats', array( - 'aside', - 'image', - 'video', - 'quote', - 'link', - 'gallery', - 'status', - 'audio', - 'chat', - ) ); - - /* - * This theme styles the visual editor to resemble the theme style, - * specifically font, colors, icons, and column width. + * @since Twenty Sixteen 1.0 */ - add_editor_style( array( 'css/editor-style.css', twentysixteen_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', 'twentysixteen' ), - 'slug' => 'dark-gray', - 'color' => '#1a1a1a', - ), - array( - 'name' => __( 'Medium Gray', 'twentysixteen' ), - 'slug' => 'medium-gray', - 'color' => '#686868', - ), - array( - 'name' => __( 'Light Gray', 'twentysixteen' ), - 'slug' => 'light-gray', - 'color' => '#e5e5e5', - ), - array( - 'name' => __( 'White', 'twentysixteen' ), - 'slug' => 'white', - 'color' => '#fff', - ), - array( - 'name' => __( 'Blue Gray', 'twentysixteen' ), - 'slug' => 'blue-gray', - 'color' => '#4d545c', - ), - array( - 'name' => __( 'Bright Blue', 'twentysixteen' ), - 'slug' => 'bright-blue', - 'color' => '#007acc', - ), - array( - 'name' => __( 'Light Blue', 'twentysixteen' ), - 'slug' => 'light-blue', - 'color' => '#9adffd', - ), - array( - 'name' => __( 'Dark Brown', 'twentysixteen' ), - 'slug' => 'dark-brown', - 'color' => '#402b30', - ), - array( - 'name' => __( 'Medium Brown', 'twentysixteen' ), - 'slug' => 'medium-brown', - 'color' => '#774e24', - ), - array( - 'name' => __( 'Dark Red', 'twentysixteen' ), - 'slug' => 'dark-red', - 'color' => '#640c1f', - ), - array( - 'name' => __( 'Bright Red', 'twentysixteen' ), - 'slug' => 'bright-red', - 'color' => '#ff675f', - ), - array( - 'name' => __( 'Yellow', 'twentysixteen' ), - 'slug' => 'yellow', - 'color' => '#ffef8e', - ), - ) ); - - // Indicate widget sidebars can use selective refresh in the Customizer. - add_theme_support( 'customize-selective-refresh-widgets' ); -} + function twentysixteen_setup() { + /* + * Make theme available for translation. + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen + * If you're building a theme based on Twenty Sixteen, use a find and replace + * to change 'twentysixteen' to the name of your theme in all the template files + */ + load_theme_textdomain( 'twentysixteen' ); + + // 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 custom logo. + * + * @since Twenty Sixteen 1.2 + */ + add_theme_support( + 'custom-logo', + array( + 'height' => 240, + 'width' => 240, + 'flex-height' => true, + ) + ); + + /* + * Enable support for Post Thumbnails on posts and pages. + * + * @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails + */ + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 1200, 9999 ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'primary' => __( 'Primary Menu', 'twentysixteen' ), + 'social' => __( 'Social Links Menu', 'twentysixteen' ), + ) + ); + + /* + * 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', + ) + ); + + /* + * 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', twentysixteen_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', 'twentysixteen' ), + 'slug' => 'dark-gray', + 'color' => '#1a1a1a', + ), + array( + 'name' => __( 'Medium Gray', 'twentysixteen' ), + 'slug' => 'medium-gray', + 'color' => '#686868', + ), + array( + 'name' => __( 'Light Gray', 'twentysixteen' ), + 'slug' => 'light-gray', + 'color' => '#e5e5e5', + ), + array( + 'name' => __( 'White', 'twentysixteen' ), + 'slug' => 'white', + 'color' => '#fff', + ), + array( + 'name' => __( 'Blue Gray', 'twentysixteen' ), + 'slug' => 'blue-gray', + 'color' => '#4d545c', + ), + array( + 'name' => __( 'Bright Blue', 'twentysixteen' ), + 'slug' => 'bright-blue', + 'color' => '#007acc', + ), + array( + 'name' => __( 'Light Blue', 'twentysixteen' ), + 'slug' => 'light-blue', + 'color' => '#9adffd', + ), + array( + 'name' => __( 'Dark Brown', 'twentysixteen' ), + 'slug' => 'dark-brown', + 'color' => '#402b30', + ), + array( + 'name' => __( 'Medium Brown', 'twentysixteen' ), + 'slug' => 'medium-brown', + 'color' => '#774e24', + ), + array( + 'name' => __( 'Dark Red', 'twentysixteen' ), + 'slug' => 'dark-red', + 'color' => '#640c1f', + ), + array( + 'name' => __( 'Bright Red', 'twentysixteen' ), + 'slug' => 'bright-red', + 'color' => '#ff675f', + ), + array( + 'name' => __( 'Yellow', 'twentysixteen' ), + 'slug' => 'yellow', + 'color' => '#ffef8e', + ), + ) + ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); + } endif; // twentysixteen_setup add_action( 'after_setup_theme', 'twentysixteen_setup' ); @@ -218,6 +232,27 @@ function twentysixteen_content_width() { add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); /** + * Add preconnect for Google Fonts. + * + * @since Twenty Sixteen 1.6 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array $urls URLs to print for resource hints. + */ +function twentysixteen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentysixteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentysixteen_resource_hints', 10, 2 ); + +/** * Registers a widget area. * * @link https://developer.wordpress.org/reference/functions/register_sidebar/ @@ -225,77 +260,86 @@ add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); * @since Twenty Sixteen 1.0 */ function twentysixteen_widgets_init() { - register_sidebar( array( - 'name' => __( 'Sidebar', 'twentysixteen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); - - register_sidebar( array( - 'name' => __( 'Content Bottom 1', 'twentysixteen' ), - 'id' => 'sidebar-2', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); - - register_sidebar( array( - 'name' => __( 'Content Bottom 2', 'twentysixteen' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), - 'before_widget' => '<section id="%1$s" class="widget %2$s">', - 'after_widget' => '</section>', - 'before_title' => '<h2 class="widget-title">', - 'after_title' => '</h2>', - ) ); + register_sidebar( + array( + 'name' => __( 'Sidebar', 'twentysixteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 1', 'twentysixteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); + + register_sidebar( + array( + 'name' => __( 'Content Bottom 2', 'twentysixteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), + 'before_widget' => '<section id="%1$s" class="widget %2$s">', + 'after_widget' => '</section>', + 'before_title' => '<h2 class="widget-title">', + 'after_title' => '</h2>', + ) + ); } add_action( 'widgets_init', 'twentysixteen_widgets_init' ); if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : -/** - * Register Google fonts for Twenty Sixteen. - * - * Create your own twentysixteen_fonts_url() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return string Google fonts URL for the theme. - */ -function twentysixteen_fonts_url() { - $fonts_url = ''; - $fonts = array(); - $subsets = 'latin,latin-ext'; - - /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { - $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; - } + /** + * Register Google fonts for Twenty Sixteen. + * + * Create your own twentysixteen_fonts_url() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string Google fonts URL for the theme. + */ + function twentysixteen_fonts_url() { + $fonts_url = ''; + $fonts = array(); + $subsets = 'latin,latin-ext'; + + /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ + if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; + } - /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ - if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { - $fonts[] = 'Montserrat:400,700'; - } + /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ + if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { + $fonts[] = 'Montserrat: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', 'twentysixteen' ) ) { - $fonts[] = 'Inconsolata:400'; - } + /* 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', 'twentysixteen' ) ) { + $fonts[] = 'Inconsolata:400'; + } - 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; /** @@ -326,7 +370,7 @@ function twentysixteen_scripts() { wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() ); // Theme block stylesheet. - wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20181018' ); + wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20181230' ); // Load the Internet Explorer specific stylesheet. wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20160816' ); @@ -354,12 +398,16 @@ function twentysixteen_scripts() { wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' ); } - wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160816', true ); + wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20181230', true ); - wp_localize_script( 'twentysixteen-script', 'screenReaderText', array( - 'expand' => __( 'expand child menu', 'twentysixteen' ), - 'collapse' => __( 'collapse child menu', 'twentysixteen' ), - ) ); + wp_localize_script( + 'twentysixteen-script', + 'screenReaderText', + array( + 'expand' => __( 'expand child menu', 'twentysixteen' ), + 'collapse' => __( 'collapse child menu', 'twentysixteen' ), + ) + ); } add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); @@ -370,7 +418,7 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); */ function twentysixteen_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' ); + wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' ); // Add custom fonts. wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); } @@ -422,10 +470,10 @@ function twentysixteen_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 ) ); @@ -433,7 +481,11 @@ function twentysixteen_hex2rgb( $color ) { return array(); } - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); + return array( + 'red' => $r, + 'green' => $g, + 'blue' => $b, + ); } /** @@ -478,7 +530,7 @@ function twentysixteen_content_image_sizes_attr( $sizes, $size ) { return $sizes; } -add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10 , 2 ); +add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10, 2 ); /** * Add custom image sizes attribute to enhance responsive image functionality @@ -501,7 +553,7 @@ function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { } return $attr; } -add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10 , 3 ); +add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10, 3 ); /** * Modifies tag cloud widget arguments to display all tags in the same font size diff --git a/themes/twentysixteen/header.php b/themes/twentysixteen/header.php index d230c4f8..f264ac2c 100644 --- a/themes/twentysixteen/header.php +++ b/themes/twentysixteen/header.php @@ -16,7 +16,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?> - <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> + <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>"> <?php endif; ?> <?php wp_head(); ?> </head> @@ -35,10 +35,12 @@ <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; ?> </div><!-- .site-branding --> @@ -50,10 +52,12 @@ <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'primary', - 'menu_class' => 'primary-menu', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'menu_class' => 'primary-menu', + ) + ); ?> </nav><!-- .main-navigation --> <?php endif; ?> @@ -61,13 +65,15 @@ <?php if ( has_nav_menu( 'social' ) ) : ?> <nav id="social-navigation" class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'twentysixteen' ); ?>"> <?php - wp_nav_menu( array( - 'theme_location' => 'social', - 'menu_class' => 'social-links-menu', - 'depth' => 1, - 'link_before' => '<span class="screen-reader-text">', - 'link_after' => '</span>', - ) ); + wp_nav_menu( + array( + 'theme_location' => 'social', + 'menu_class' => 'social-links-menu', + 'depth' => 1, + 'link_before' => '<span class="screen-reader-text">', + 'link_after' => '</span>', + ) + ); ?> </nav><!-- .social-navigation --> <?php endif; ?> diff --git a/themes/twentysixteen/image.php b/themes/twentysixteen/image.php index 434b0b02..5fcbb901 100644 --- a/themes/twentysixteen/image.php +++ b/themes/twentysixteen/image.php @@ -14,93 +14,99 @@ 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', 'twentysixteen' ) ); ?></div> - <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></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', 'twentysixteen' ) ); ?></div> + <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></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 twentysixteen image attachment size. - * - * @since Twenty Sixteen 1.0 - * - * @param string $image_size Image size. Default 'large'. - */ - $image_size = apply_filters( 'twentysixteen_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 twentysixteen image attachment size. + * + * @since Twenty Sixteen 1.0 + * + * @param string $image_size Image size. Default 'large'. + */ + $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' ); + + echo wp_get_attachment_image( get_the_ID(), $image_size ); + ?> - <?php twentysixteen_excerpt( 'entry-caption' ); ?> + <?php twentysixteen_excerpt( 'entry-caption' ); ?> </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:', 'twentysixteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + ) + ); ?> </div><!-- .entry-content --> <footer class="entry-footer"> - <?php twentysixteen_entry_meta(); ?> + <?php twentysixteen_entry_meta(); ?> <?php - // Retrieve attachment metadata. - $metadata = wp_get_attachment_metadata(); - if ( $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>', - esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), - esc_url( wp_get_attachment_url() ), - absint( $metadata['width'] ), - absint( $metadata['height'] ) - ); - } + // Retrieve attachment metadata. + $metadata = wp_get_attachment_metadata(); + if ( $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>', + esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), + esc_url( wp_get_attachment_url() ), + absint( $metadata['width'] ), + absint( $metadata['height'] ) + ); + } ?> <?php - edit_post_link( - sprintf( - /* translators: %s: Name of current post */ - __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), - get_the_title() - ), - '<span class="edit-link">', - '</span>' - ); + edit_post_link( + sprintf( + /* translators: %s: Name of current post */ + __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), + get_the_title() + ), + '<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(); - } - - // Parent post navigation. - the_post_navigation( array( + // If comments are open or we have at least one comment, load up the comment template. + if ( comments_open() || get_comments_number() ) { + comments_template(); + } + + // Parent 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', 'twentysixteen' ), - ) ); + ) + ); // End the loop. endwhile; ?> diff --git a/themes/twentysixteen/inc/back-compat.php b/themes/twentysixteen/inc/back-compat.php index 7ed4240c..c97940e0 100644 --- a/themes/twentysixteen/inc/back-compat.php +++ b/themes/twentysixteen/inc/back-compat.php @@ -50,9 +50,13 @@ function twentysixteen_upgrade_notice() { * @global string $wp_version WordPress version. */ function twentysixteen_customize() { - wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + '', + array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentysixteen_customize' ); diff --git a/themes/twentysixteen/inc/customizer.php b/themes/twentysixteen/inc/customizer.php index 62eb1b0b..9867d3d9 100644 --- a/themes/twentysixteen/inc/customizer.php +++ b/themes/twentysixteen/inc/customizer.php @@ -30,9 +30,15 @@ function twentysixteen_custom_header_and_background() { * @type string $default-color Default color of the background. * } */ - add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array( - 'default-color' => $default_background_color, - ) ) ); + add_theme_support( + 'custom-background', + apply_filters( + 'twentysixteen_custom_background_args', + array( + 'default-color' => $default_background_color, + ) + ) + ); /** * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. @@ -50,35 +56,41 @@ function twentysixteen_custom_header_and_background() { * displayed on the blog. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array( - 'default-text-color' => $default_text_color, - 'width' => 1200, - 'height' => 280, - 'flex-height' => true, - 'wp-head-callback' => 'twentysixteen_header_style', - ) ) ); + add_theme_support( + 'custom-header', + apply_filters( + 'twentysixteen_custom_header_args', + array( + 'default-text-color' => $default_text_color, + 'width' => 1200, + 'height' => 280, + 'flex-height' => true, + 'wp-head-callback' => 'twentysixteen_header_style', + ) + ) + ); } add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); if ( ! function_exists( 'twentysixteen_header_style' ) ) : -/** - * Styles the header text displayed on the site. - * - * Create your own twentysixteen_header_style() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @see twentysixteen_custom_header_and_background(). - */ -function twentysixteen_header_style() { - // If the header text option is untouched, let's bail. - if ( display_header_text() ) { - return; - } + /** + * Styles the header text displayed on the site. + * + * Create your own twentysixteen_header_style() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @see twentysixteen_custom_header_and_background(). + */ + function twentysixteen_header_style() { + // If the header text option is untouched, let's bail. + if ( display_header_text() ) { + return; + } - // If the header text has been hidden. - ?> - <style type="text/css" id="twentysixteen-header-css"> + // If the header text has been hidden. + ?> + <style type="text/css" id="twentysixteen-header-css"> .site-branding { margin: 0 auto 0 0; } @@ -88,9 +100,9 @@ function twentysixteen_header_style() { clip: rect(1px, 1px, 1px, 1px); position: absolute; } - </style> - <?php -} + </style> + <?php + } endif; // twentysixteen_header_style /** @@ -103,87 +115,135 @@ endif; // twentysixteen_header_style function twentysixteen_customize_register( $wp_customize ) { $color_scheme = twentysixteen_get_color_scheme(); - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $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' => 'twentysixteen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentysixteen_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', + array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', + array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentysixteen_customize_partial_blogdescription', + ) + ); } // Add color scheme setting and control. - $wp_customize->add_setting( 'color_scheme', array( - 'default' => 'default', - 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( 'color_scheme', array( - 'label' => __( 'Base Color Scheme', 'twentysixteen' ), - 'section' => 'colors', - 'type' => 'select', - 'choices' => twentysixteen_get_color_scheme_choices(), - 'priority' => 1, - ) ); + $wp_customize->add_setting( + 'color_scheme', + array( + 'default' => 'default', + 'sanitize_callback' => 'twentysixteen_sanitize_color_scheme', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + 'color_scheme', + array( + 'label' => __( 'Base Color Scheme', 'twentysixteen' ), + 'section' => 'colors', + 'type' => 'select', + 'choices' => twentysixteen_get_color_scheme_choices(), + 'priority' => 1, + ) + ); // Add page background color setting and control. - $wp_customize->add_setting( 'page_background_color', array( - 'default' => $color_scheme[1], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'page_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, 'page_background_color', array( - 'label' => __( 'Page Background Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'page_background_color', + array( + 'label' => __( 'Page Background Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Remove the core header textcolor control, as it shares the main text color. $wp_customize->remove_control( 'header_textcolor' ); // Add link color setting and control. - $wp_customize->add_setting( 'link_color', array( - 'default' => $color_scheme[2], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'link_color', + array( + 'default' => $color_scheme[2], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( - 'label' => __( 'Link Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'link_color', + array( + 'label' => __( 'Link Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add main text color setting and control. - $wp_customize->add_setting( 'main_text_color', array( - 'default' => $color_scheme[3], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); + $wp_customize->add_setting( + 'main_text_color', + array( + 'default' => $color_scheme[3], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array( - 'label' => __( 'Main Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'main_text_color', + array( + 'label' => __( 'Main Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); // Add secondary text color setting and control. - $wp_customize->add_setting( 'secondary_text_color', array( - 'default' => $color_scheme[4], - 'sanitize_callback' => 'sanitize_hex_color', - 'transport' => 'postMessage', - ) ); - - $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array( - 'label' => __( 'Secondary Text Color', 'twentysixteen' ), - 'section' => 'colors', - ) ) ); + $wp_customize->add_setting( + 'secondary_text_color', + array( + 'default' => $color_scheme[4], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Color_Control( + $wp_customize, + 'secondary_text_color', + array( + 'label' => __( 'Secondary Text Color', 'twentysixteen' ), + 'section' => 'colors', + ) + ) + ); } add_action( 'customize_register', 'twentysixteen_customize_register', 11 ); @@ -248,127 +308,130 @@ function twentysixteen_get_color_schemes() { * } * } */ - return apply_filters( 'twentysixteen_color_schemes', array( - 'default' => array( - 'label' => __( 'Default', 'twentysixteen' ), - 'colors' => array( - '#1a1a1a', - '#ffffff', - '#007acc', - '#1a1a1a', - '#686868', + return apply_filters( + 'twentysixteen_color_schemes', + array( + 'default' => array( + 'label' => __( 'Default', 'twentysixteen' ), + 'colors' => array( + '#1a1a1a', + '#ffffff', + '#007acc', + '#1a1a1a', + '#686868', + ), ), - ), - 'dark' => array( - 'label' => __( 'Dark', 'twentysixteen' ), - 'colors' => array( - '#262626', - '#1a1a1a', - '#9adffd', - '#e5e5e5', - '#c1c1c1', + 'dark' => array( + 'label' => __( 'Dark', 'twentysixteen' ), + 'colors' => array( + '#262626', + '#1a1a1a', + '#9adffd', + '#e5e5e5', + '#c1c1c1', + ), ), - ), - 'gray' => array( - 'label' => __( 'Gray', 'twentysixteen' ), - 'colors' => array( - '#616a73', - '#4d545c', - '#c7c7c7', - '#f2f2f2', - '#f2f2f2', + 'gray' => array( + 'label' => __( 'Gray', 'twentysixteen' ), + 'colors' => array( + '#616a73', + '#4d545c', + '#c7c7c7', + '#f2f2f2', + '#f2f2f2', + ), ), - ), - 'red' => array( - 'label' => __( 'Red', 'twentysixteen' ), - 'colors' => array( - '#ffffff', - '#ff675f', - '#640c1f', - '#402b30', - '#402b30', + 'red' => array( + 'label' => __( 'Red', 'twentysixteen' ), + 'colors' => array( + '#ffffff', + '#ff675f', + '#640c1f', + '#402b30', + '#402b30', + ), ), - ), - 'yellow' => array( - 'label' => __( 'Yellow', 'twentysixteen' ), - 'colors' => array( - '#3b3721', - '#ffef8e', - '#774e24', - '#3b3721', - '#5b4d3e', + 'yellow' => array( + 'label' => __( 'Yellow', 'twentysixteen' ), + 'colors' => array( + '#3b3721', + '#ffef8e', + '#774e24', + '#3b3721', + '#5b4d3e', + ), ), - ), - ) ); + ) + ); } if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : -/** - * Retrieves the current Twenty Sixteen color scheme. - * - * Create your own twentysixteen_get_color_scheme() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array An associative array of either the current or default color scheme HEX values. - */ -function twentysixteen_get_color_scheme() { - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); - $color_schemes = twentysixteen_get_color_schemes(); + /** + * Retrieves the current Twenty Sixteen color scheme. + * + * Create your own twentysixteen_get_color_scheme() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array An associative array of either the current or default color scheme HEX values. + */ + function twentysixteen_get_color_scheme() { + $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); + $color_schemes = twentysixteen_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; // twentysixteen_get_color_scheme if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) : -/** - * Retrieves an array of color scheme choices registered for Twenty Sixteen. - * - * Create your own twentysixteen_get_color_scheme_choices() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return array Array of color schemes. - */ -function twentysixteen_get_color_scheme_choices() { - $color_schemes = twentysixteen_get_color_schemes(); - $color_scheme_control_options = array(); + /** + * Retrieves an array of color scheme choices registered for Twenty Sixteen. + * + * Create your own twentysixteen_get_color_scheme_choices() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return array Array of color schemes. + */ + function twentysixteen_get_color_scheme_choices() { + $color_schemes = twentysixteen_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; // twentysixteen_get_color_scheme_choices if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) : -/** - * Handles sanitization for Twenty Sixteen color schemes. - * - * Create your own twentysixteen_sanitize_color_scheme() function to override - * in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @param string $value Color scheme name value. - * @return string Color scheme name. - */ -function twentysixteen_sanitize_color_scheme( $value ) { - $color_schemes = twentysixteen_get_color_scheme_choices(); + /** + * Handles sanitization for Twenty Sixteen color schemes. + * + * Create your own twentysixteen_sanitize_color_scheme() function to override + * in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @param string $value Color scheme name value. + * @return string Color scheme name. + */ + function twentysixteen_sanitize_color_scheme( $value ) { + $color_schemes = twentysixteen_get_color_scheme_choices(); - if ( ! array_key_exists( $value, $color_schemes ) ) { - return 'default'; - } + if ( ! array_key_exists( $value, $color_schemes ) ) { + return 'default'; + } - return $value; -} + return $value; + } endif; // twentysixteen_sanitize_color_scheme /** @@ -445,14 +508,17 @@ add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' ); * @return string Color scheme CSS. */ function twentysixteen_get_color_scheme_css( $colors ) { - $colors = wp_parse_args( $colors, array( - 'background_color' => '', - 'page_background_color' => '', - 'link_color' => '', - 'main_text_color' => '', - 'secondary_text_color' => '', - 'border_color' => '', - ) ); + $colors = wp_parse_args( + $colors, + array( + 'background_color' => '', + 'page_background_color' => '', + 'link_color' => '', + 'main_text_color' => '', + 'secondary_text_color' => '', + 'border_color' => '', + ) + ); return <<<CSS /* Color Scheme */ @@ -869,9 +935,9 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_page_background_color_css', 11 * @see wp_add_inline_style() */ function twentysixteen_link_color_css() { - $color_scheme = twentysixteen_get_color_scheme(); - $default_color = $color_scheme[2]; - $link_color = get_theme_mod( 'link_color', $default_color ); + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[2]; + $link_color = get_theme_mod( 'link_color', $default_color ); // Don't do anything if the current color is the default. if ( $link_color === $default_color ) { @@ -1126,8 +1192,8 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 ); * @see wp_add_inline_style() */ function twentysixteen_secondary_text_color_css() { - $color_scheme = twentysixteen_get_color_scheme(); - $default_color = $color_scheme[4]; + $color_scheme = twentysixteen_get_color_scheme(); + $default_color = $color_scheme[4]; $secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color ); // Don't do anything if the current color is the default. diff --git a/themes/twentysixteen/inc/template-tags.php b/themes/twentysixteen/inc/template-tags.php index 9b8f1f39..caeed1c5 100644 --- a/themes/twentysixteen/inc/template-tags.php +++ b/themes/twentysixteen/inc/template-tags.php @@ -10,127 +10,133 @@ */ if ( ! function_exists( 'twentysixteen_entry_meta' ) ) : -/** - * Prints HTML with meta information for the categories, tags. - * - * Create your own twentysixteen_entry_meta() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_meta() { - if ( 'post' === get_post_type() ) { - $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); - printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', - get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), - _x( 'Author', 'Used before post author name.', 'twentysixteen' ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); - } + /** + * Prints HTML with meta information for the categories, tags. + * + * Create your own twentysixteen_entry_meta() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_meta() { + if ( 'post' === get_post_type() ) { + $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); + printf( + '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', + get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), + _x( 'Author', 'Used before post author name.', 'twentysixteen' ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } - if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { - twentysixteen_entry_date(); - } + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + twentysixteen_entry_date(); + } - $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.', 'twentysixteen' ) ), - esc_url( get_post_format_link( $format ) ), - get_post_format_string( $format ) - ); - } + $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.', 'twentysixteen' ) ), + esc_url( get_post_format_link( $format ) ), + get_post_format_string( $format ) + ); + } - if ( 'post' === get_post_type() ) { - twentysixteen_entry_taxonomies(); - } + if ( 'post' === get_post_type() ) { + twentysixteen_entry_taxonomies(); + } - if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { - echo '<span class="comments-link">'; - comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); - echo '</span>'; + if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { + echo '<span class="comments-link">'; + comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); + echo '</span>'; + } } -} endif; if ( ! function_exists( 'twentysixteen_entry_date' ) ) : -/** - * Prints HTML with date information for current post. - * - * Create your own twentysixteen_entry_date() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_date() { - $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; + /** + * Prints HTML with date information for current post. + * + * Create your own twentysixteen_entry_date() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_date() { + $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; - if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { - $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; - } + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; + } - $time_string = sprintf( $time_string, - esc_attr( get_the_date( 'c' ) ), - get_the_date(), - esc_attr( get_the_modified_date( 'c' ) ), - get_the_modified_date() - ); - - 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.', 'twentysixteen' ), - esc_url( get_permalink() ), - $time_string - ); -} -endif; + $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 ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : -/** - * Prints HTML with category and tags for current post. - * - * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_entry_taxonomies() { - $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - if ( $categories_list && twentysixteen_categorized_blog() ) { - printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', - _x( 'Categories', 'Used before category names.', 'twentysixteen' ), - $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.', 'twentysixteen' ), + esc_url( get_permalink() ), + $time_string ); } +endif; - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); - 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.', 'twentysixteen' ), - $tags_list - ); +if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : + /** + * Prints HTML with category and tags for current post. + * + * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_entry_taxonomies() { + $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + if ( $categories_list && twentysixteen_categorized_blog() ) { + printf( + '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', + _x( 'Categories', 'Used before category names.', 'twentysixteen' ), + $categories_list + ); + } + + $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); + 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.', 'twentysixteen' ), + $tags_list + ); + } } -} endif; if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : -/** - * Displays an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index views, or a div - * element when on single views. - * - * Create your own twentysixteen_post_thumbnail() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - */ -function twentysixteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + * + * Create your own twentysixteen_post_thumbnail() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + */ + function twentysixteen_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 : ?> @@ -139,8 +145,9 @@ function twentysixteen_post_thumbnail() { <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?> </a> - <?php endif; // End is_singular() -} + <?php + endif; // End is_singular() + } endif; if ( ! function_exists( 'twentysixteen_excerpt' ) ) : @@ -158,69 +165,74 @@ if ( ! function_exists( 'twentysixteen_excerpt' ) ) : function twentysixteen_excerpt( $class = 'entry-summary' ) { $class = esc_attr( $class ); - if ( has_excerpt() || is_search() ) : ?> + if ( has_excerpt() || is_search() ) : + ?> <div class="<?php echo $class; ?>"> <?php the_excerpt(); ?> </div><!-- .<?php echo $class; ?> --> - <?php endif; + <?php + endif; } endif; if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) : -/** - * Replaces "[...]" (appended to automatically generated excerpts) with ... and - * a 'Continue reading' link. - * - * Create your own twentysixteen_excerpt_more() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return string 'Continue reading' link prepended with an ellipsis. - */ -function twentysixteen_excerpt_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<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) - ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and + * a 'Continue reading' link. + * + * Create your own twentysixteen_excerpt_more() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return string 'Continue reading' link prepended with an ellipsis. + */ + function twentysixteen_excerpt_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<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); endif; if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : -/** - * Determines whether blog/site has more than one category. - * - * Create your own twentysixteen_categorized_blog() function to override in a child theme. - * - * @since Twenty Sixteen 1.0 - * - * @return bool True if there is more than one category, false otherwise. - */ -function twentysixteen_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { - // Create an array of all the categories that are attached to posts. - $all_the_cool_cats = get_categories( array( - 'fields' => 'ids', - // 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 ); - - set_transient( 'twentysixteen_categories', $all_the_cool_cats ); - } + /** + * Determines whether blog/site has more than one category. + * + * Create your own twentysixteen_categorized_blog() function to override in a child theme. + * + * @since Twenty Sixteen 1.0 + * + * @return bool True if there is more than one category, false otherwise. + */ + function twentysixteen_categorized_blog() { + if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { + // Create an array of all the categories that are attached to posts. + $all_the_cool_cats = get_categories( + array( + 'fields' => 'ids', + // We only need to know if there is more than one category. + 'number' => 2, + ) + ); - if ( $all_the_cool_cats > 1 || is_preview() ) { - // This blog has more than 1 category so twentysixteen_categorized_blog should return true. - return true; - } else { - // This blog has only 1 category so twentysixteen_categorized_blog should return false. - return false; + // Count the number of categories that are attached to the posts. + $all_the_cool_cats = count( $all_the_cool_cats ); + + set_transient( 'twentysixteen_categories', $all_the_cool_cats ); + } + + if ( $all_the_cool_cats > 1 || is_preview() ) { + // This blog has more than 1 category so twentysixteen_categorized_blog should return true. + return true; + } else { + // This blog has only 1 category so twentysixteen_categorized_blog should return false. + return false; + } } -} endif; /** @@ -236,19 +248,19 @@ function twentysixteen_category_transient_flusher() { delete_transient( 'twentysixteen_categories' ); } add_action( 'edit_category', 'twentysixteen_category_transient_flusher' ); -add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); +add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : -/** - * Displays the optional custom logo. - * - * Does nothing if the custom logo is not available. - * - * @since Twenty Sixteen 1.2 - */ -function twentysixteen_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 Sixteen 1.2 + */ + function twentysixteen_the_custom_logo() { + if ( function_exists( 'the_custom_logo' ) ) { + the_custom_logo(); + } } -} endif; diff --git a/themes/twentysixteen/index.php b/themes/twentysixteen/index.php index 3f621abe..f6ec56c1 100644 --- a/themes/twentysixteen/index.php +++ b/themes/twentysixteen/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. * - * @link https://codex.wordpress.org/Template_Hierarchy + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * * @package WordPress * @subpackage Twenty_Sixteen @@ -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( 'template-parts/content', get_post_format() ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); - // If no content, include the "No posts found" template. + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/page.php b/themes/twentysixteen/page.php index 315a3da7..a232c9fc 100644 --- a/themes/twentysixteen/page.php +++ b/themes/twentysixteen/page.php @@ -17,7 +17,8 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); // Include the page content template. get_template_part( 'template-parts/content', 'page' ); diff --git a/themes/twentysixteen/readme.txt b/themes/twentysixteen/readme.txt index e1741beb..dcc28905 100644 --- a/themes/twentysixteen/readme.txt +++ b/themes/twentysixteen/readme.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 4.4 Tested up to: WordPress 5.0 -Version: 1.7 +Version: 1.9 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog @@ -56,6 +56,16 @@ Image used in screenshot.png: A photo by Austin Schmid (https://unsplash.com/sch == Changelog == += 1.9 = +* Released: February 21, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.9 + += 1.8 = +* Released: January 9, 2019 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.8 + = 1.7 = * Released: December 19, 2018 diff --git a/themes/twentysixteen/search.php b/themes/twentysixteen/search.php index 4180b5f9..0f893636 100644 --- a/themes/twentysixteen/search.php +++ b/themes/twentysixteen/search.php @@ -20,7 +20,8 @@ get_header(); ?> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); /** * Run the loop for the search to output the results. @@ -29,17 +30,19 @@ get_header(); ?> */ get_template_part( 'template-parts/content', 'search' ); - // End the loop. + // End the loop. endwhile; // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', - ) ); - - // If no content, include the "No posts found" template. + the_posts_pagination( + array( + 'prev_text' => __( 'Previous page', 'twentysixteen' ), + 'next_text' => __( 'Next page', 'twentysixteen' ), + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', + ) + ); + + // If no content, include the "No posts found" template. else : get_template_part( 'template-parts/content', 'none' ); diff --git a/themes/twentysixteen/sidebar.php b/themes/twentysixteen/sidebar.php index d4d893eb..45aff971 100644 --- a/themes/twentysixteen/sidebar.php +++ b/themes/twentysixteen/sidebar.php @@ -8,7 +8,7 @@ */ ?> -<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> +<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> <aside id="secondary" class="sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'sidebar-1' ); ?> </aside><!-- .sidebar .widget-area --> diff --git a/themes/twentysixteen/single.php b/themes/twentysixteen/single.php index 07e0df29..34541703 100644 --- a/themes/twentysixteen/single.php +++ b/themes/twentysixteen/single.php @@ -13,7 +13,8 @@ get_header(); ?> <main id="main" class="site-main" role="main"> <?php // Start the loop. - while ( have_posts() ) : the_post(); + while ( have_posts() ) : + the_post(); // Include the single post content template. get_template_part( 'template-parts/content', 'single' ); @@ -25,19 +26,23 @@ get_header(); ?> if ( is_singular( 'attachment' ) ) { // Parent 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', 'twentysixteen' ), - ) ); + the_post_navigation( + array( + 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ), + ) + ); } elseif ( is_singular( 'post' ) ) { // Previous/next post navigation. - the_post_navigation( array( - 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' . - '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' . - '<span class="post-title">%title</span>', - ) ); + the_post_navigation( + array( + 'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + 'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' . + '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' . + '<span class="post-title">%title</span>', + ) + ); } // End of the loop. diff --git a/themes/twentysixteen/style.css b/themes/twentysixteen/style.css index f5a854ea..90c8b4c4 100644 --- a/themes/twentysixteen/style.css +++ b/themes/twentysixteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentysixteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. -Version: 1.7 +Version: 1.9 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog diff --git a/themes/twentysixteen/template-parts/content-page.php b/themes/twentysixteen/template-parts/content-page.php index 2b57d2b5..d1ee87c6 100644 --- a/themes/twentysixteen/template-parts/content-page.php +++ b/themes/twentysixteen/template-parts/content-page.php @@ -19,14 +19,16 @@ <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); ?> </div><!-- .entry-content --> @@ -40,6 +42,6 @@ '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); - ?> + ?> </article><!-- #post-## --> diff --git a/themes/twentysixteen/template-parts/content-single.php b/themes/twentysixteen/template-parts/content-single.php index 241f5285..d1061b27 100644 --- a/themes/twentysixteen/template-parts/content-single.php +++ b/themes/twentysixteen/template-parts/content-single.php @@ -21,19 +21,21 @@ <?php the_content(); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); if ( '' !== get_the_author_meta( 'description' ) ) { get_template_part( 'template-parts/biography' ); } - ?> + ?> </div><!-- .entry-content --> <footer class="entry-footer"> @@ -48,6 +50,6 @@ '<span class="edit-link">', '</span>' ); - ?> + ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> diff --git a/themes/twentysixteen/template-parts/content.php b/themes/twentysixteen/template-parts/content.php index 22b0ea41..cf88417f 100644 --- a/themes/twentysixteen/template-parts/content.php +++ b/themes/twentysixteen/template-parts/content.php @@ -24,20 +24,24 @@ <div class="entry-content"> <?php /* translators: %s: Name of current post */ - the_content( sprintf( - __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), - get_the_title() - ) ); + the_content( + sprintf( + __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), + get_the_title() + ) + ); - wp_link_pages( array( - 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', - 'after' => '</div>', - 'link_before' => '<span>', - 'link_after' => '</span>', - 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', - 'separator' => '<span class="screen-reader-text">, </span>', - ) ); - ?> + wp_link_pages( + array( + 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', + 'after' => '</div>', + 'link_before' => '<span>', + 'link_after' => '</span>', + 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', + 'separator' => '<span class="screen-reader-text">, </span>', + ) + ); + ?> </div><!-- .entry-content --> <footer class="entry-footer"> @@ -52,6 +56,6 @@ '<span class="edit-link">', '</span>' ); - ?> + ?> </footer><!-- .entry-footer --> </article><!-- #post-## --> |