Index: site-template/themes/trunk/twentyseventeen/template-parts/post/content-gallery.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/post/content-gallery.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/post/content-gallery.php (revision 1409) @@ -0,0 +1,92 @@ + + +
> + 'thumb-tack' ) ); + } + ?> +
+ '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo ''; + }; + + if ( is_single() ) { + the_title( '

', '

' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

', '

' ); + } else { + the_title( '

', '

' ); + } + ?> +
+ + +
+ + + +
+ + +
+ + '; + echo get_post_gallery(); + echo '
'; + }; + + }; + + if ( is_single() || ! get_post_gallery() ) { + + /* translators: %s: Name of current post */ + the_content( sprintf( + __( 'Continue reading "%s"', 'twentyseventeen' ), + get_the_title() + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); + + }; + ?> + + + + + +
Index: site-template/themes/trunk/twentyseventeen/search.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/search.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/search.php (revision 1409) @@ -0,0 +1,62 @@ + + +
+ + + +
+
+ + twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) ); + + else : ?> + +

+ + +
+
+ +
+ + + + Index: site-template/themes/trunk/twentyseventeen/assets/js/navigation.js =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/js/navigation.js (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/js/navigation.js (revision 1409) @@ -0,0 +1,109 @@ +/* global twentyseventeenScreenReaderText */ +/** + * Theme functions file. + * + * Contains handlers for navigation and widget area. + */ + +(function( $ ) { + var masthead, menuToggle, siteNavContain, siteNavigation; + + function initMainNavigation( container ) { + + // Add dropdown toggle that displays child menu items. + var dropdownToggle = $( ' + + 'top', + 'menu_id' => 'top-menu', + ) ); ?> + + + 'arrow-right' ) ); ?> + + Index: site-template/themes/trunk/twentyseventeen/template-parts/header/site-branding.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/header/site-branding.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/header/site-branding.php (revision 1409) @@ -0,0 +1,38 @@ + +
+
+ + + +
+ +

+ +

+ + + +

+ +
+ + + 'arrow-right' ) ); ?> + + +
+
Index: site-template/themes/trunk/twentyseventeen/rtl.css =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/rtl.css (revision 0) +++ site-template/themes/trunk/twentyseventeen/rtl.css (revision 1409) @@ -0,0 +1,552 @@ +/* +Theme Name: Twenty Seventeen + +Adding support for languages written in a Right To Left (RTL) direction is easy, +it's just a matter of overwriting all the horizontal positioning attributes +of your CSS stylesheet in a separate stylesheet file named rtl.css. + +https://codex.wordpress.org/Right-to-Left_Language_Support + +*/ + +/* Reset */ + +body { + direction: rtl; + unicode-bidi: embed; +} + +th { + text-align: right; +} + +/* Accessibility */ + +.screen-reader-text:focus { + left: auto; + right: 5px; +} + +/* Typography */ + +textarea { + padding-right: 3px; +} + +li > ul, +li > ol { + margin-left: 0; + margin-right: 1.5em; +} + +th:first-child, +td:first-child { + padding-left: 0.4em; + padding-right: 0; +} + +th:last-child, +td:last-child { + padding-left: 0; + padding-right: 0.4em; +} + +/* Forms */ + +input[type="radio"], +input[type="checkbox"] { + margin-left: 0.5em; + margin-right: 0; +} + +/* Media */ + +.mejs-offscreen { + right: -10000px; +} + +/* Site Branding */ + +.custom-logo-link { + padding-left: 1em; + padding-right: 0; +} + +/* Main Navigation */ + +.main-navigation ul { + text-align: right; +} + +.main-navigation ul ul { + padding-left: 0; + padding-right: 1.5em; +} + +.menu-toggle .icon { + margin-left: 0.5em; + margin-right: 0; +} + +.dropdown-toggle { + left: -0.5em; + right: auto; +} + +/* Front Page */ + +.wp-custom-header-video-button { + left: 30px; + right: auto; +} + +.twentyseventeen-panel .recent-posts .entry-header .edit-link { + margin-left: 0; + margin-right: 1em; +} + +/* Blog, Archive, Search */ + +.blog .entry-meta a.post-edit-link, +.archive .entry-meta a.post-edit-link, +.search .entry-meta a.post-edit-link { + margin-left: 0; + margin-right: 1em; +} + +.search .page .entry-meta a.post-edit-link { + margin-right: 0; +} + +.sticky .icon-thumb-tack { + left: auto; + right: -1.5em; +} + +.prev.page-numbers .icon, +.next.page-numbers .icon { + display: inline-block; + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +.prev.page-numbers { + float: right; +} + +.next.page-numbers { + float: left; +} + +.nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + margin-left: 0.5em; + margin-right: 0; +} + +.nav-links .nav-next .nav-title .nav-title-icon-wrapper { + margin-left: 0; + margin-right: 0.5em; +} + +/* Blog Entries */ + +.entry-footer .cat-links, +.entry-footer .tags-links { + padding-left: 0; + padding-right: 2.5em; +} + +.entry-footer .cat-links .icon, +.entry-footer .tags-links .icon { + left: auto; + margin-left: 0.5em; + margin-right: 0; + right: 0; +} + +/* Comments */ + +.comment-body { + margin-left: 0; + margin-right: 65px; +} + +.comment-reply-link .icon { + left: auto; + right: -2em; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.comment-author .avatar { + left: auto; + right: -65px; +} + +.comment-reply-link:before { + left: auto; + right: -2em; +} + +.children .comment-author .avatar { + left: auto; + right: -45px; +} + +.form-submit { + text-align: left; +} + +/* Post Formats */ + +.format-quote blockquote .icon { + left: auto; + right: -1.25em; + -webkit-transform: none; + -ms-transform: none; + transform: none; +} + +/* Post Navigation */ + +.nav-links .nav-previous .nav-title .nav-title-icon-wrapper, +.nav-links .nav-next .nav-title .nav-title-icon-wrapper { + display: inline-block; + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); +} + +/* Widgets */ + +.widget ul { + margin: 0; +} + +.search-form .search-submit { + left: 3px; + right: auto; +} + +.tagcloud ul li { + float: right; + margin: 4px 0 0 4px; +} + +.widget ul li li { + padding-left: 0; + padding-right: 1.5rem; +} + +.widget_text ul { + margin: 0 1.5em 1.5em 0; +} + +.widget_text ul li ul { + margin: 0 1.5em 0 0; +} + +/* Footer */ + +.social-navigation a { + margin-left: 1em; + margin-right: 0; +} + +/* Customizer styles */ + +.twentyseventeen-customizer.twentyseventeen-front-page .twentyseventeen-panel .twentyseventeen-panel-title { + left: 3.2em; + right: auto; +} + +/* Gallery Styles */ + +.gallery-item, +.gallery-caption { + text-align: right; +} + +/* SVG Fallback */ + +.no-svg .dropdown-toggle { + left: 0; + right: auto; +} + +/* Media queries */ + +@media screen and (min-width: 48em) { + + body.page-template-full-width-page #primary { + float: none; + } + + .has-sidebar:not(.error404) #primary { + float: right; + } + + .has-sidebar #secondary { + float: left; + } + + .error404 #primary { + float: none; + } + + /* Site Branding */ + + .custom-logo-link { + padding-left: 2em; + padding-right: 0; + } + + /* Navigation */ + + .main-navigation ul ul { + padding-right: 0; + } + + .main-navigation ul ul:before, + .main-navigation ul ul:after { + left: 0.5em; + right: auto; + } + + .main-navigation ul ul, + .main-navigation ul ul ul { + left: auto; + right: -999em; + } + + .main-navigation ul ul li:hover > ul, + .main-navigation ul ul li.focus > ul { + left: auto; + right: 100%; + } + + .main-navigation ul li:hover > ul, + .main-navigation ul li.focus > ul { + left: auto; + right: 0.5em; + } + + .main-navigation ul li.menu-item-has-children:before, + .main-navigation ul li.menu-item-has-children:after, + .main-navigation ul li.page_item_has_children:before, + .main-navigation ul li.page_item_has_children:after { + left: 1em; + right: auto; + } + + .main-navigation .menu-item-has-children > a > .icon, + .main-navigation .page_item_has_children > a > .icon { + left: auto; + right: 5px; + } + + .main-navigation ul ul .menu-item-has-children > a > .icon, + .main-navigation ul ul .page_item_has_children > a > .icon { + left: 1em; + right: auto; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); + } + + /* Scroll down arrow */ + + .navigation-top .menu-scroll-down { + left: 0; + right: auto; + } + + .site-header .menu-scroll-down { + left: 0; + right: auto; + } + + .entry-title a { + margin-left: auto; + margin-right: -2px; + } + + /* Front Page */ + + .page-two-column .panel-content .entry-header { + float: right; + } + + .page-two-column .panel-content .entry-content { + float: left; + } + + /* Front Page - Recent Posts */ + + .page-two-column .panel-content .recent-posts { + clear: left; + float: left; + } + + /* Blog, Archive, Search */ + + .sticky .icon-thumb-tack { + left: auto; + right: -2.5em; + } + + body:not(.has-sidebar):not(.page-one-column) .page-header, + body.has-sidebar.error404 #primary .page-header, + body.page-two-column:not(.archive) #primary .entry-header, + body.page-two-column.archive:not(.has-sidebar) #primary .page-header { + float: right; + } + + .blog:not(.has-sidebar) #primary article, + .archive:not(.has-sidebar):not(.page-one-column) #primary article, + .search:not(.has-sidebar) #primary article, + .has-sidebar.error404 #primary .page-content, + .error404.has-sidebar #primary .page-content, + body.page-two-column:not(.archive) #primary .entry-content, + body.page-two-column #comments { + float: left; + } + + .entry-footer .edit-link a.post-edit-link { + margin-left: 0; + margin-right: 1em; + } + + /* Entry content */ + + /* with sidebar */ + + .has-sidebar .entry-content blockquote.alignleft { + margin-left: 0; + width: 34%; + } + + .has-sidebar #primary .entry-content blockquote.alignright, + .has-sidebar #primary .entry-content blockquote.alignright.below-entry-meta { + margin-right: 0; + width: 34%; + } + + .has-sidebar #primary .entry-content blockquote.alignleft.below-entry-meta { + margin-left: -72.5%; + width: 62%; + } + + /* blog index and archive */ + + .blog:not(.has-sidebar) .entry-content blockquote.alignleft, + .twentyseventeen-front-page.page-two-column .entry-content blockquote.alignleft, + .archive:not(.has-sidebar) .entry-content blockquote.alignleft, + .page-two-column .entry-content blockquote.alignleft { + margin-left: 0; + width: 34%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignright, + .twentyseventeen-front-page.page-two-column #primary .entry-content blockquote.alignright, + .archive:not(.has-sidebar) .entry-content blockquote.alignright, + .page-two-column #primary .entry-content blockquote.alignright { + margin-right: -72.5%; + width: 62%; + } + + /* Post formats */ + + .format-quote blockquote .icon { + left: auto; + right: -1.5em; + } + + .navigation.pagination { + float: left; + } + + .has-sidebar .navigation.pagination, + .archive.page-one-column:not(.has-sidebar) .navigation.pagination { + float: none; + } + + .post-navigation .nav-previous { + float: right; + } + + .post-navigation .nav-next { + float: left; + text-align: left; + } + + /* Comments */ + + ol.children .children { + padding-left: 0; + padding-right: 2em; + } + + /* Post Navigation */ + + .nav-links .nav-previous .nav-title .nav-title-icon-wrapper { + left: auto; + right: -2em; + } + + .nav-links .nav-next .nav-title .nav-title-icon-wrapper { + left: -2em; + right: auto; + } + + /* Footer */ + + .site-footer .widget-column.footer-widget-1 { + float: right; + } + + .site-footer .widget-column.footer-widget-2 { + float: left; + } + + .social-navigation { + clear: right; + float: right; + } + + .site-info { + float: right; + } + + .social-navigation + .site-info { + margin-left: 0; + margin-right: 6%; + } +} + +@media screen and (min-width: 67em) { + + /* Sticky posts */ + + .sticky .icon-thumb-tack { + left: auto; + right: -1.25em; + } +} + +@media screen and (min-width: 79em) { + + .has-sidebar #primary .entry-content blockquote.alignright, + .has-sidebar #primary .entry-content blockquote.alignright.below-entry-meta { + margin-right: -20%; + } + + .blog:not(.has-sidebar) .entry-content blockquote.alignleft, + .archive:not(.has-sidebar) .entry-content blockquote.alignleft, + .page-two-column .entry-content blockquote.alignleft, + .twentyseventeen-front-page .entry-content blockquote.alignleft { + margin-left: -20%; + } +} Index: site-template/themes/trunk/twentyseventeen/assets/js/customize-preview.js =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/js/customize-preview.js (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/js/customize-preview.js (revision 1409) @@ -0,0 +1,150 @@ +/** + * File customize-preview.js. + * + * Instantly live-update customizer settings in the preview for improved user experience. + */ + +(function( $ ) { + + // Collect information from customize-controls.js about which panels are opening. + wp.customize.bind( 'preview-ready', function() { + + // Initially hide the theme option placeholders on load + $( '.panel-placeholder' ).hide(); + + wp.customize.preview.bind( 'section-highlight', function( data ) { + + // Only on the front page. + if ( ! $( 'body' ).hasClass( 'twentyseventeen-front-page' ) ) { + return; + } + + // When the section is expanded, show and scroll to the content placeholders, exposing the edit links. + if ( true === data.expanded ) { + $( 'body' ).addClass( 'highlight-front-sections' ); + $( '.panel-placeholder' ).slideDown( 200, function() { + $.scrollTo( $( '#panel1' ), { + duration: 600, + offset: { 'top': -70 } // Account for sticky menu. + }); + }); + + // If we've left the panel, hide the placeholders and scroll back to the top. + } else { + $( 'body' ).removeClass( 'highlight-front-sections' ); + // Don't change scroll when leaving - it's likely to have unintended consequences. + $( '.panel-placeholder' ).slideUp( 200 ); + } + }); + }); + + // Site title and description. + wp.customize( 'blogname', function( value ) { + value.bind( function( to ) { + $( '.site-title a' ).text( to ); + }); + }); + wp.customize( 'blogdescription', function( value ) { + value.bind( function( to ) { + $( '.site-description' ).text( to ); + }); + }); + + // Header text color. + wp.customize( 'header_textcolor', function( value ) { + value.bind( function( to ) { + if ( 'blank' === to ) { + $( '.site-title, .site-description' ).css({ + clip: 'rect(1px, 1px, 1px, 1px)', + position: 'absolute' + }); + // Add class for different logo styles if title and description are hidden. + $( 'body' ).addClass( 'title-tagline-hidden' ); + } else { + + // Check if the text color has been removed and use default colors in theme stylesheet. + if ( ! to.length ) { + $( '#twentyseventeen-custom-header-styles' ).remove(); + } + $( '.site-title, .site-description' ).css({ + clip: 'auto', + position: 'relative' + }); + $( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({ + color: to + }); + // Add class for different logo styles if title and description are visible. + $( 'body' ).removeClass( 'title-tagline-hidden' ); + } + }); + }); + + // Color scheme. + wp.customize( 'colorscheme', function( value ) { + value.bind( function( to ) { + + // Update color body class. + $( 'body' ) + .removeClass( 'colors-light colors-dark colors-custom' ) + .addClass( 'colors-' + to ); + }); + }); + + // Custom color hue. + wp.customize( 'colorscheme_hue', function( value ) { + value.bind( function( to ) { + + // Update custom color CSS. + var style = $( '#custom-theme-colors' ), + hue = style.data( 'hue' ), + css = style.html(); + + // Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed. + css = css.split( hue + ',' ).join( to + ',' ); + style.html( css ).data( 'hue', to ); + }); + }); + + // Page layouts. + wp.customize( 'page_layout', function( value ) { + value.bind( function( to ) { + if ( 'one-column' === to ) { + $( 'body' ).addClass( 'page-one-column' ).removeClass( 'page-two-column' ); + } else { + $( 'body' ).removeClass( 'page-one-column' ).addClass( 'page-two-column' ); + } + } ); + } ); + + // Whether a header image is available. + function hasHeaderImage() { + var image = wp.customize( 'header_image' )(); + return '' !== image && 'remove-header' !== image; + } + + // Whether a header video is available. + function hasHeaderVideo() { + var externalVideo = wp.customize( 'external_header_video' )(), + video = wp.customize( 'header_video' )(); + + return '' !== externalVideo || ( 0 !== video && '' !== video ); + } + + // Toggle a body class if a custom header exists. + $.each( [ 'external_header_video', 'header_image', 'header_video' ], function( index, settingId ) { + wp.customize( settingId, function( setting ) { + setting.bind(function() { + if ( hasHeaderImage() ) { + $( document.body ).addClass( 'has-header-image' ); + } else { + $( document.body ).removeClass( 'has-header-image' ); + } + + if ( ! hasHeaderVideo() ) { + $( document.body ).removeClass( 'has-header-video' ); + } + } ); + } ); + } ); + +} )( jQuery ); Index: site-template/themes/trunk/twentyseventeen/assets/css/ie8.css =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/css/ie8.css (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/css/ie8.css (revision 1409) @@ -0,0 +1,225 @@ +/* +Theme Name: Twenty Seventeen +Description: IE8 specific style. +*/ + +body { + font-size: 16px; +} + +h1 { + font-size: 30px; + font-size: 1.875rem; +} + +h2, +.page .panel-content .recent-posts .entry-title { + font-size: 26px; + font-size: 1.625rem; +} + +h3 { + font-size: 22px; + font-size: 1.375rem; +} + +h4 { + font-size: 18px; + font-size: 1.125rem; +} + +h5 { + font-size: 13px; + font-size: 0.8125rem; +} + +h6 { + font-size: 16px; + font-size: 1rem; +} + +img { + width: inherit; /* Make images fill their parent's space. */ +} + +/* Fixes linked images */ +.entry-content a img, +.widget a img { + filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=0, OffY=5, Color=#ffffff); +} + +/* Layout */ + +.site-content { + padding: 6.5em 0 0; +} + +/* Site Branding */ + +.custom-header { + overflow: hidden; +} + +.has-header-image.twentyseventeen-front-page .custom-header, +.has-header-image.home.blog .custom-header { + display: block; +} + +.custom-header-media { + background-position: bottom center; +} + +.site-branding { + padding: 45px 0; +} + +.has-header-image.twentyseventeen-front-page .site-branding, +.has-header-image.home.blog .site-branding { + bottom: 0; + display: block; + left: 0; + height: auto; + padding-top: 0; + position: absolute; + width: 100%; +} + +.has-header-image .custom-header-media img { + left: 0; + top: 0; +} + +.site-title { + font-size: 36px; + font-weight: 700; +} + +.site-description { + font-size: 16px; +} + +/* Main Navigation */ + +.navigation-top { + background: #fff; + position: relative; + z-index: 10; +} + +.menu-toggle { + width: 150px; +} + +.main-navigation ul#top-menu { + margin-bottom: -1px; + padding: 0; +} + +.no-svg .dropdown-toggle { + padding: 0.25em 0 0; +} + +.no-svg .dropdown-toggle.toggled-on { + padding: 0.75em 0 0; +} + +.dropdown-toggle .svg-fallback.icon-angle-down { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=-1, M12=1.2246467991473532e-16, M21=-1.2246467991473532e-16, M22=-1, SizingMethod='auto expand')"; +} + +.dropdown-toggle.toggled-on .svg-fallback.icon-angle-down { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand')"; +} + +/* Front Page */ + +.twentyseventeen-front-page.has-header-image .custom-header, +.blog.home.has-header-image .custom-header, +.panel-image { + height: 800px; + max-height: 800px; + padding-top: 0; +} + +.twentyseventeen-front-page .custom-header-media, +.blog.home .custom-header-media { + background-position: center center; +} + +.twentyseventeen-front-page.has-header-image .site-branding, +.home.blog.has-header-image .site-branding { + bottom: 20px; + position: absolute; + width: 100%; +} + +.page .panel-content .entry-title, +.page-title, +.page .entry-title { + font-size: 14px; + font-size: 0.875rem; + font-weight: 700; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +/* Posts */ + +.blog .site-main > article, +.archive .site-main > article, +.search .site-main > article { + padding-bottom: 4em; +} + +time.updated { + display: none; +} + +time.published { + display: inline-block; +} + +.blog .entry-title { + padding-top: 0; +} + +.single-post .entry-title, +.page .entry-title, +.entry-meta + .entry-title { + font-size: 26px; + font-weight: 400; + letter-spacing: normal; + padding-top: 0; + text-transform: none; +} + +.entry-footer .cat-links, +.entry-footer .tags-links { + padding-left: 0; +} + +.comment-author .avatar { + z-index: -1; +} + +ol.children .children { + padding-left: 2em; +} + +/* RTL Styles */ + +.rtl .has-header-image.twentyseventeen-front-page .site-branding, +.rtl .has-header-image.home.blog .site-branding { + left: auto; + right: 0; +} + +.rtl .entry-footer .cat-links, +.rtl .entry-footer .tags-links { + padding-right: 0; +} + +.rtl ol.children .children { + padding-left: 0; + padding-right: 2em; +} Index: site-template/themes/trunk/twentyseventeen/template-parts/post/content-video.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/post/content-video.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/post/content-video.php (revision 1409) @@ -0,0 +1,103 @@ + + +
> + 'thumb-tack' ) ); + } + ?> +
+ '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + } + echo ''; + }; + + if ( is_single() ) { + the_title( '

', '

' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

', '

' ); + } else { + the_title( '

', '

' ); + } + ?> +
+ + + + +
+ + + +
+ + +
+ + '; + echo $video_html; + echo '
'; + } + }; + + }; + + if ( is_single() || empty( $video ) ) { + + /* translators: %s: Name of current post */ + the_content( sprintf( + __( 'Continue reading "%s"', 'twentyseventeen' ), + get_the_title() + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); + }; + ?> + + + + + +
Index: site-template/themes/trunk/twentyseventeen/template-parts/footer/site-info.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/footer/site-info.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/footer/site-info.php (revision 1409) @@ -0,0 +1,14 @@ + +
+ +
Index: site-template/themes/trunk/twentyseventeen/index.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/index.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/index.php (revision 1409) @@ -0,0 +1,67 @@ + + +
+ + + + + + +
+
+ + twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '' . __( 'Previous page', 'twentyseventeen' ) . '', + 'next_text' => '' . __( 'Next page', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), + 'before_page_number' => '' . __( 'Page', 'twentyseventeen' ) . ' ', + ) ); + + else : + + get_template_part( 'template-parts/post/content', 'none' ); + + endif; + ?> + +
+
+ +
+ + + +
+
+
+ + + +
+
+
+ + + +
> +
+ ', '' ); ?> + +
+
+ '', + ) ); + ?> +
+
Index: site-template/themes/trunk/twentyseventeen/inc/customizer.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/inc/customizer.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/inc/customizer.php (revision 1409) @@ -0,0 +1,210 @@ +get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + $wp_customize->selective_refresh->add_partial( 'blogname', array( + 'selector' => '.site-title a', + 'render_callback' => 'twentyseventeen_customize_partial_blogname', + ) ); + $wp_customize->selective_refresh->add_partial( 'blogdescription', array( + 'selector' => '.site-description', + 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', + ) ); + + /** + * Custom colors. + */ + $wp_customize->add_setting( 'colorscheme', array( + 'default' => 'light', + 'transport' => 'postMessage', + 'sanitize_callback' => 'twentyseventeen_sanitize_colorscheme', + ) ); + + $wp_customize->add_setting( 'colorscheme_hue', array( + 'default' => 250, + 'transport' => 'postMessage', + 'sanitize_callback' => 'absint', // The hue is stored as a positive integer. + ) ); + + $wp_customize->add_control( 'colorscheme', array( + 'type' => 'radio', + 'label' => __( 'Color Scheme', 'twentyseventeen' ), + 'choices' => array( + 'light' => __( 'Light', 'twentyseventeen' ), + 'dark' => __( 'Dark', 'twentyseventeen' ), + 'custom' => __( 'Custom', 'twentyseventeen' ), + ), + 'section' => 'colors', + 'priority' => 5, + ) ); + + $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'colorscheme_hue', array( + 'mode' => 'hue', + 'section' => 'colors', + 'priority' => 6, + ) ) ); + + /** + * Theme options. + */ + $wp_customize->add_section( 'theme_options', array( + 'title' => __( 'Theme Options', 'twentyseventeen' ), + 'priority' => 130, // Before Additional CSS. + ) ); + + $wp_customize->add_setting( 'page_layout', array( + 'default' => 'two-column', + 'sanitize_callback' => 'twentyseventeen_sanitize_page_layout', + 'transport' => 'postMessage', + ) ); + + $wp_customize->add_control( 'page_layout', array( + 'label' => __( 'Page Layout', 'twentyseventeen' ), + 'section' => 'theme_options', + 'type' => 'radio', + 'description' => __( 'When the two-column layout is assigned, the page title is in one column and content is in the other.', 'twentyseventeen' ), + 'choices' => array( + 'one-column' => __( 'One Column', 'twentyseventeen' ), + 'two-column' => __( 'Two Column', 'twentyseventeen' ), + ), + 'active_callback' => 'twentyseventeen_is_view_with_layout_option', + ) ); + + /** + * Filter number of front page sections in Twenty Seventeen. + * + * @since Twenty Seventeen 1.0 + * + * @param int $num_sections Number of front page sections. + */ + $num_sections = apply_filters( 'twentyseventeen_front_page_sections', 4 ); + + // Create a setting and control for each of the sections available in the theme. + for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { + $wp_customize->add_setting( 'panel_' . $i, array( + 'default' => false, + 'sanitize_callback' => 'absint', + 'transport' => 'postMessage', + ) ); + + $wp_customize->add_control( 'panel_' . $i, array( + /* translators: %d is the front page section number */ + 'label' => sprintf( __( 'Front Page Section %d Content', 'twentyseventeen' ), $i ), + 'description' => ( 1 !== $i ? '' : __( 'Select pages to feature in each area from the dropdowns. Add an image to a section by setting a featured image in the page editor. Empty sections will not be displayed.', 'twentyseventeen' ) ), + 'section' => 'theme_options', + 'type' => 'dropdown-pages', + 'allow_addition' => true, + 'active_callback' => 'twentyseventeen_is_static_front_page', + ) ); + + $wp_customize->selective_refresh->add_partial( 'panel_' . $i, array( + 'selector' => '#panel' . $i, + 'render_callback' => 'twentyseventeen_front_page_section', + 'container_inclusive' => true, + ) ); + } +} +add_action( 'customize_register', 'twentyseventeen_customize_register' ); + +/** + * Sanitize the page layout options. + * + * @param string $input Page layout. + */ +function twentyseventeen_sanitize_page_layout( $input ) { + $valid = array( + 'one-column' => __( 'One Column', 'twentyseventeen' ), + 'two-column' => __( 'Two Column', 'twentyseventeen' ), + ); + + if ( array_key_exists( $input, $valid ) ) { + return $input; + } + + return ''; +} + +/** + * Sanitize the colorscheme. + * + * @param string $input Color scheme. + */ +function twentyseventeen_sanitize_colorscheme( $input ) { + $valid = array( 'light', 'dark', 'custom' ); + + if ( in_array( $input, $valid, true ) ) { + return $input; + } + + return 'light'; +} + +/** + * Render the site title for the selective refresh partial. + * + * @since Twenty Seventeen 1.0 + * @see twentyseventeen_customize_register() + * + * @return void + */ +function twentyseventeen_customize_partial_blogname() { + bloginfo( 'name' ); +} + +/** + * Render the site tagline for the selective refresh partial. + * + * @since Twenty Seventeen 1.0 + * @see twentyseventeen_customize_register() + * + * @return void + */ +function twentyseventeen_customize_partial_blogdescription() { + bloginfo( 'description' ); +} + +/** + * Return whether we're previewing the front page and it's a static page. + */ +function twentyseventeen_is_static_front_page() { + return ( is_front_page() && ! is_home() ); +} + +/** + * Return whether we're on a view that supports a one or two column layout. + */ +function twentyseventeen_is_view_with_layout_option() { + // This option is available on all pages. It's also available on archives when there isn't a sidebar. + return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) ); +} + +/** + * Bind JS handlers to instantly live-preview changes. + */ +function twentyseventeen_customize_preview_js() { + wp_enqueue_script( 'twentyseventeen-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview' ), '1.0', true ); +} +add_action( 'customize_preview_init', 'twentyseventeen_customize_preview_js' ); + +/** + * Load dynamic logic for the customizer controls area. + */ +function twentyseventeen_panels_js() { + wp_enqueue_script( 'twentyseventeen-customize-controls', get_theme_file_uri( '/assets/js/customize-controls.js' ), array(), '1.0', true ); +} +add_action( 'customize_controls_enqueue_scripts', 'twentyseventeen_panels_js' ); Index: site-template/themes/trunk/twentyseventeen/assets/js/jquery.scrollTo.js =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/js/jquery.scrollTo.js (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/js/jquery.scrollTo.js (revision 1409) @@ -0,0 +1,209 @@ +/*! + * jQuery.scrollTo + * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com + * Licensed under MIT + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery + * @author Ariel Flesler + * @version 2.1.2 + */ +;(function(factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define( ['jquery'], factory ); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS + module.exports = factory( require( 'jquery' ) ); + } else { + // Global + factory( jQuery ); + } +})(function($) { + 'use strict'; + + var $scrollTo = $.scrollTo = function(target, duration, settings) { + return $( window ).scrollTo( target, duration, settings ); + }; + + $scrollTo.defaults = { + axis:'xy', + duration: 0, + limit:true + }; + + function isWin(elem) { + return ! elem.nodeName || + $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) !== -1; + } + + $.fn.scrollTo = function(target, duration, settings) { + if (typeof duration === 'object') { + settings = duration; + duration = 0; + } + if (typeof settings === 'function') { + settings = { onAfter:settings }; + } + if (target === 'max') { + target = 9e9; + } + + settings = $.extend( {}, $scrollTo.defaults, settings ); + // Speed is still recognized for backwards compatibility + duration = duration || settings.duration; + // Make sure the settings are given right + var queue = settings.queue && settings.axis.length > 1; + if (queue) { + // Let's keep the overall duration + duration /= 2; + } + settings.offset = both( settings.offset ); + settings.over = both( settings.over ); + + return this.each(function() { + // Null target yields nothing, just like jQuery does + if (target === null) { return; } + + var win = isWin( this ), + elem = win ? this.contentWindow || window : this, + $elem = $( elem ), + targ = target, + attr = {}, + toff; + + switch (typeof targ) { + // A number will pass the regex + case 'number': + case 'string': + if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test( targ )) { + targ = both( targ ); + // We are done + break; + } + // Relative/Absolute selector + targ = win ? $( targ ) : $( targ, elem ); + /* falls through */ + case 'object': + if (targ.length === 0) { return; } + // DOMElement / jQuery + if (targ.is || targ.style) { + // Get the real position of the target + toff = (targ = $( targ )).offset(); + } + } + + var offset = $.isFunction( settings.offset ) && settings.offset( elem, targ ) || settings.offset; + + $.each(settings.axis.split( '' ), function(i, axis) { + var Pos = axis === 'x' ? 'Left' : 'Top', + pos = Pos.toLowerCase(), + key = 'scroll' + Pos, + prev = $elem[key](), + max = $scrollTo.max( elem, axis ); + + if (toff) {// jQuery / DOMElement + attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]); + + // If it's a dom element, reduce the margin + if (settings.margin) { + attr[key] -= parseInt( targ.css( 'margin' + Pos ), 10 ) || 0; + attr[key] -= parseInt( targ.css( 'border' + Pos + 'Width' ), 10 ) || 0; + } + + attr[key] += offset[pos] || 0; + + if (settings.over[pos]) { + // Scroll to a fraction of its width/height + attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos]; + } + } else { + var val = targ[pos]; + // Handle percentage values + attr[key] = val.slice && val.slice( -1 ) === '%' ? + parseFloat( val ) / 100 * max + : val; + } + + // Number or 'number' + if (settings.limit && /^\d+$/.test( attr[key] )) { + // Check the limits + attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max ); + } + + // Don't waste time animating, if there's no need. + if ( ! i && settings.axis.length > 1) { + if (prev === attr[key]) { + // No animation needed + attr = {}; + } else if (queue) { + // Intermediate animation + animate( settings.onAfterFirst ); + // Don't animate this axis again in the next iteration. + attr = {}; + } + } + }); + + animate( settings.onAfter ); + + function animate(callback) { + var opts = $.extend({}, settings, { + // The queue setting conflicts with animate() + // Force it to always be true + queue: true, + duration: duration, + complete: callback && function() { + callback.call( elem, targ, settings ); + } + }); + $elem.animate( attr, opts ); + } + }); + }; + + // Max scrolling position, works on quirks mode + // It only fails (not too badly) on IE, quirks mode. + $scrollTo.max = function(elem, axis) { + var Dim = axis === 'x' ? 'Width' : 'Height', + scroll = 'scroll' + Dim; + + if ( ! isWin( elem )) { + return elem[scroll] - $( elem )[Dim.toLowerCase()](); } + + var size = 'client' + Dim, + doc = elem.ownerDocument || elem.document, + html = doc.documentElement, + body = doc.body; + + return Math.max( html[scroll], body[scroll] ) - Math.min( html[size], body[size] ); + }; + + function both(val) { + return $.isFunction( val ) || $.isPlainObject( val ) ? val : { top:val, left:val }; + } + + // Add special hooks so that window scroll properties can be animated + $.Tween.propHooks.scrollLeft = $.Tween.propHooks.scrollTop = { + get: function(t) { + return $( t.elem )[t.prop](); + }, + set: function(t) { + var curr = this.get( t ); + // If interrupt is true and user scrolled, stop animating + if (t.options.interrupt && t._last && t._last !== curr) { + return $( t.elem ).stop(); + } + var next = Math.round( t.now ); + // Don't waste CPU + // Browsers don't render floating point scroll + if (curr !== next) { + $( t.elem )[t.prop](next); + t._last = this.get( t ); + } + } + }; + + // AMD requirement + return $scrollTo; +}); Index: site-template/themes/trunk/twentyseventeen/searchform.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/searchform.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/searchform.php (revision 1409) @@ -0,0 +1,21 @@ + + + + + Index: site-template/themes/trunk/twentyseventeen/template-parts/post/content-image.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/post/content-image.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/post/content-image.php (revision 1409) @@ -0,0 +1,81 @@ + + +
> + 'thumb-tack' ) ); + } + ?> +
+ '; + if ( is_single() ) { + twentyseventeen_posted_on(); + } else { + echo twentyseventeen_time_link(); + twentyseventeen_edit_link(); + }; + echo ''; + }; + + if ( is_single() ) { + the_title( '

', '

' ); + } elseif ( is_front_page() && is_home() ) { + the_title( '

', '

' ); + } else { + the_title( '

', '

' ); + } + ?> +
+ + +
+ + + +
+ + +
+ + "%s"', 'twentyseventeen' ), + get_the_title() + ) ); + + wp_link_pages( array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) ); + + }; + ?> + +
+ + + +
Index: site-template/themes/trunk/twentyseventeen/front-page.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/front-page.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/front-page.php (revision 1409) @@ -0,0 +1,54 @@ + + +
+
+ + + + + +
+
+ + + +
+
+
+ + '' . __( 'Previous Post', 'twentyseventeen' ) . ' ' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '%title', + 'next_text' => '' . __( 'Next Post', 'twentyseventeen' ) . ' %title' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '', + ) ); + + endwhile; // End of the loop. + ?> + +
+
+ +
+ + + +
+ +
+ + +

Get started here.', 'twentyseventeen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

+ + + +

+ +
+
Index: site-template/themes/trunk/twentyseventeen/assets/js/global.js =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/js/global.js (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/js/global.js (revision 1409) @@ -0,0 +1,249 @@ +/* global twentyseventeenScreenReaderText */ +(function( $ ) { + + // Variables and DOM Caching. + var $body = $( 'body' ), + $customHeader = $body.find( '.custom-header' ), + $branding = $customHeader.find( '.site-branding' ), + $navigation = $body.find( '.navigation-top' ), + $navWrap = $navigation.find( '.wrap' ), + $navMenuItem = $navigation.find( '.menu-item' ), + $menuToggle = $navigation.find( '.menu-toggle' ), + $menuScrollDown = $body.find( '.menu-scroll-down' ), + $sidebar = $body.find( '#secondary' ), + $entryContent = $body.find( '.entry-content' ), + $formatQuote = $body.find( '.format-quote blockquote' ), + isFrontPage = $body.hasClass( 'twentyseventeen-front-page' ) || $body.hasClass( 'home blog' ), + navigationFixedClass = 'site-navigation-fixed', + navigationHeight, + navigationOuterHeight, + navPadding, + navMenuItemHeight, + idealNavHeight, + navIsNotTooTall, + headerOffset, + menuTop = 0, + resizeTimer; + + // Ensure the sticky navigation doesn't cover current focused links. + $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() { + if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { + var windowScrollTop = $( window ).scrollTop(), + fixedNavHeight = $navigation.height(), + itemScrollTop = $( this ).offset().top, + offsetDiff = itemScrollTop - windowScrollTop; + + // Account for Admin bar. + if ( $( '#wpadminbar' ).length ) { + offsetDiff -= $( '#wpadminbar' ).height(); + } + + if ( offsetDiff < fixedNavHeight ) { + $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 0 ); + } + } + }); + + // Set properties of navigation. + function setNavProps() { + navigationHeight = $navigation.height(); + navigationOuterHeight = $navigation.outerHeight(); + navPadding = parseFloat( $navWrap.css( 'padding-top' ) ) * 2; + navMenuItemHeight = $navMenuItem.outerHeight() * 2; + idealNavHeight = navPadding + navMenuItemHeight; + navIsNotTooTall = navigationHeight <= idealNavHeight; + } + + // Make navigation 'stick'. + function adjustScrollClass() { + + // Make sure we're not on a mobile screen. + if ( 'none' === $menuToggle.css( 'display' ) ) { + + // Make sure the nav isn't taller than two rows. + if ( navIsNotTooTall ) { + + // When there's a custom header image or video, the header offset includes the height of the navigation. + if ( isFrontPage && ( $body.hasClass( 'has-header-image' ) || $body.hasClass( 'has-header-video' ) ) ) { + headerOffset = $customHeader.innerHeight() - navigationOuterHeight; + } else { + headerOffset = $customHeader.innerHeight(); + } + + // If the scroll is more than the custom header, set the fixed class. + if ( $( window ).scrollTop() >= headerOffset ) { + $navigation.addClass( navigationFixedClass ); + } else { + $navigation.removeClass( navigationFixedClass ); + } + + } else { + + // Remove 'fixed' class if nav is taller than two rows. + $navigation.removeClass( navigationFixedClass ); + } + } + } + + // Set margins of branding in header. + function adjustHeaderHeight() { + if ( 'none' === $menuToggle.css( 'display' ) ) { + + // The margin should be applied to different elements on front-page or home vs interior pages. + if ( isFrontPage ) { + $branding.css( 'margin-bottom', navigationOuterHeight ); + } else { + $customHeader.css( 'margin-bottom', navigationOuterHeight ); + } + + } else { + $customHeader.css( 'margin-bottom', '0' ); + $branding.css( 'margin-bottom', '0' ); + } + } + + // Set icon for quotes. + function setQuotesIcon() { + $( twentyseventeenScreenReaderText.quote ).prependTo( $formatQuote ); + } + + // Add 'below-entry-meta' class to elements. + function belowEntryMetaClass( param ) { + var sidebarPos, sidebarPosBottom; + + if ( ! $body.hasClass( 'has-sidebar' ) || ( + $body.hasClass( 'search' ) || + $body.hasClass( 'single-attachment' ) || + $body.hasClass( 'error404' ) || + $body.hasClass( 'twentyseventeen-front-page' ) + ) ) { + return; + } + + sidebarPos = $sidebar.offset(); + sidebarPosBottom = sidebarPos.top + ( $sidebar.height() + 28 ); + + $entryContent.find( param ).each( function() { + var $element = $( this ), + elementPos = $element.offset(), + elementPosTop = elementPos.top; + + // Add 'below-entry-meta' to elements below the entry meta. + if ( elementPosTop > sidebarPosBottom ) { + $element.addClass( 'below-entry-meta' ); + } else { + $element.removeClass( 'below-entry-meta' ); + } + }); + } + + /* + * Test if inline SVGs are supported. + * @link https://github.com/Modernizr/Modernizr/ + */ + function supportsInlineSVG() { + var div = document.createElement( 'div' ); + div.innerHTML = ''; + return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI ); + } + + /** + * Test if an iOS device. + */ + function checkiOS() { + return /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream; + } + + /* + * Test if background-attachment: fixed is supported. + * @link http://stackoverflow.com/questions/14115080/detect-support-for-background-attachment-fixed + */ + function supportsFixedBackground() { + var el = document.createElement('div'), + isSupported; + + try { + if ( ! ( 'backgroundAttachment' in el.style ) || checkiOS() ) { + return false; + } + el.style.backgroundAttachment = 'fixed'; + isSupported = ( 'fixed' === el.style.backgroundAttachment ); + return isSupported; + } + catch (e) { + return false; + } + } + + // Fire on document ready. + $( document ).ready( function() { + + // If navigation menu is present on page, setNavProps and adjustScrollClass. + if ( $navigation.length ) { + setNavProps(); + adjustScrollClass(); + } + + // If 'Scroll Down' arrow in present on page, calculate scroll offset and bind an event handler to the click event. + if ( $menuScrollDown.length ) { + + if ( $( 'body' ).hasClass( 'admin-bar' ) ) { + menuTop -= 32; + } + if ( $( 'body' ).hasClass( 'blog' ) ) { + menuTop -= 30; // The div for latest posts has no space above content, add some to account for this. + } + if ( ! $navigation.length ) { + navigationOuterHeight = 0; + } + + $menuScrollDown.click( function( e ) { + e.preventDefault(); + $( window ).scrollTo( '#primary', { + duration: 600, + offset: { top: menuTop - navigationOuterHeight } + }); + }); + } + + adjustHeaderHeight(); + setQuotesIcon(); + if ( true === supportsInlineSVG() ) { + document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' ); + } + + if ( true === supportsFixedBackground() ) { + document.documentElement.className += ' background-fixed'; + } + }); + + // If navigation menu is present on page, adjust it on scroll and screen resize. + if ( $navigation.length ) { + + // On scroll, we want to stick/unstick the navigation. + $( window ).on( 'scroll', function() { + adjustScrollClass(); + adjustHeaderHeight(); + }); + + // Also want to make sure the navigation is where it should be on resize. + $( window ).resize( function() { + setNavProps(); + setTimeout( adjustScrollClass, 500 ); + }); + } + + $( window ).resize( function() { + clearTimeout( resizeTimer ); + resizeTimer = setTimeout( function() { + belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); + }, 300 ); + setTimeout( adjustHeaderHeight, 1000 ); + }); + + // Add header video class after the video is loaded. + $( document ).on( 'wp-custom-header-video-loaded', function() { + $body.addClass( 'has-header-video' ); + }); + +})( jQuery ); Index: site-template/themes/trunk/twentyseventeen/inc/back-compat.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/inc/back-compat.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/inc/back-compat.php (revision 1409) @@ -0,0 +1,69 @@ +

%s

', $message ); +} + +/** + * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Seventeen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentyseventeen_customize() { + wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ), '', array( + 'back_link' => true, + ) ); +} +add_action( 'load-customize.php', 'twentyseventeen_customize' ); + +/** + * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. + * + * @since Twenty Seventeen 1.0 + * + * @global string $wp_version WordPress version. + */ +function twentyseventeen_preview() { + if ( isset( $_GET['preview'] ) ) { + wp_die( sprintf( __( 'Twenty Seventeen requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'twentyseventeen' ), $GLOBALS['wp_version'] ) ); + } +} +add_action( 'template_redirect', 'twentyseventeen_preview' ); Index: site-template/themes/trunk/twentyseventeen/inc/color-patterns.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/inc/color-patterns.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/inc/color-patterns.php (revision 1409) @@ -0,0 +1,573 @@ + .comment-body > .comment-meta > .comment-author .avatar { + border-color: hsl( ' . $hue . ', ' . $reduced_saturation . ', 20% ); /* base: #333; */ +} + +.colors-custom h2, +.colors-custom blockquote, +.colors-custom input[type="text"], +.colors-custom input[type="email"], +.colors-custom input[type="url"], +.colors-custom input[type="password"], +.colors-custom input[type="search"], +.colors-custom input[type="number"], +.colors-custom input[type="tel"], +.colors-custom input[type="range"], +.colors-custom input[type="date"], +.colors-custom input[type="month"], +.colors-custom input[type="week"], +.colors-custom input[type="time"], +.colors-custom input[type="datetime"], +.colors-custom input[type="datetime-local"], +.colors-custom input[type="color"], +.colors-custom textarea, +.colors-custom .site-description, +.colors-custom .entry-content blockquote.alignleft, +.colors-custom .entry-content blockquote.alignright, +.colors-custom .colors-custom .taxonomy-description, +.colors-custom .site-info a, +.colors-custom .wp-caption, +.colors-custom .gallery-caption { + color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ +} + +.colors-custom abbr, +.colors-custom acronym { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 40% ); /* base: #666; */ +} + +.colors-custom h5, +.colors-custom .entry-meta, +.colors-custom .entry-meta a, +.colors-custom.blog .entry-meta a.post-edit-link, +.colors-custom.archive .entry-meta a.post-edit-link, +.colors-custom.search .entry-meta a.post-edit-link, +.colors-custom .nav-subtitle, +.colors-custom .comment-metadata, +.colors-custom .comment-metadata a, +.colors-custom .no-comments, +.colors-custom .comment-awaiting-moderation, +.colors-custom .page-numbers.current, +.colors-custom .page-links .page-number, +.colors-custom .navigation-top .current-menu-item > a, +.colors-custom .navigation-top .current_page_item > a, +.colors-custom .main-navigation a:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-current-item .wp-playlist-item-artist { + color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ +} + +.colors-custom button:hover, +.colors-custom button:focus, +.colors-custom input[type="button"]:hover, +.colors-custom input[type="button"]:focus, +.colors-custom input[type="submit"]:hover, +.colors-custom input[type="submit"]:focus, +.colors-custom .entry-footer .edit-link a.post-edit-link:hover, +.colors-custom .entry-footer .edit-link a.post-edit-link:focus, +.colors-custom .social-navigation a, +.colors-custom .prev.page-numbers:focus, +.colors-custom .prev.page-numbers:hover, +.colors-custom .next.page-numbers:focus, +.colors-custom .next.page-numbers:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus { + background: hsl( ' . esc_attr( $hue ) . ', ' . esc_attr( $saturation ) . ', 46% ); /* base: #767676; */ +} + +.colors-custom button.secondary:hover, +.colors-custom button.secondary:focus, +.colors-custom input[type="reset"]:hover, +.colors-custom input[type="reset"]:focus, +.colors-custom input[type="button"].secondary:hover, +.colors-custom input[type="button"].secondary:focus, +.colors-custom input[type="reset"].secondary:hover, +.colors-custom input[type="reset"].secondary:focus, +.colors-custom input[type="submit"].secondary:hover, +.colors-custom input[type="submit"].secondary:focus, +.colors-custom hr { + background: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom input[type="text"], +.colors-custom input[type="email"], +.colors-custom input[type="url"], +.colors-custom input[type="password"], +.colors-custom input[type="search"], +.colors-custom input[type="number"], +.colors-custom input[type="tel"], +.colors-custom input[type="range"], +.colors-custom input[type="date"], +.colors-custom input[type="month"], +.colors-custom input[type="week"], +.colors-custom input[type="time"], +.colors-custom input[type="datetime"], +.colors-custom input[type="datetime-local"], +.colors-custom input[type="color"], +.colors-custom textarea, +.colors-custom select, +.colors-custom fieldset, +.colors-custom .widget .tagcloud a:hover, +.colors-custom .widget .tagcloud a:focus, +.colors-custom .widget.widget_tag_cloud a:hover, +.colors-custom .widget.widget_tag_cloud a:focus, +.colors-custom .wp_widget_tag_cloud a:hover, +.colors-custom .wp_widget_tag_cloud a:focus { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom thead th { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom .entry-footer .cat-links .icon, +.colors-custom .entry-footer .tags-links .icon { + color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ +} + +.colors-custom button.secondary, +.colors-custom input[type="reset"], +.colors-custom input[type="button"].secondary, +.colors-custom input[type="reset"].secondary, +.colors-custom input[type="submit"].secondary, +.colors-custom .prev.page-numbers, +.colors-custom .next.page-numbers { + background-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom .widget .tagcloud a, +.colors-custom .widget.widget_tag_cloud a, +.colors-custom .wp_widget_tag_cloud a { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom.twentyseventeen-front-page article:not(.has-post-thumbnail):not(:first-child), +.colors-custom .widget ul li { + border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom .widget ul li { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */ +} + +.colors-custom pre, +.colors-custom mark, +.colors-custom ins { + background: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .navigation-top, +.colors-custom .main-navigation > div > ul, +.colors-custom .pagination, +.colors-custom .comments-pagination, +.colors-custom .entry-footer, +.colors-custom .site-footer { + border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .navigation-top, +.colors-custom .main-navigation li, +.colors-custom .entry-footer, +.colors-custom .single-featured-image-header, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item, +.colors-custom tr { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .site-content .wp-playlist-light { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 93% ); /* base: #eee; */ +} + +.colors-custom .site-header, +.colors-custom .single-featured-image-header { + background-color: hsl( ' . $hue . ', ' . $saturation . ', 98% ); /* base: #fafafa; */ +} + +.colors-custom button, +.colors-custom input[type="button"], +.colors-custom input[type="submit"], +.colors-custom .entry-footer .edit-link a.post-edit-link, +.colors-custom .social-navigation a, +.colors-custom .site-content .wp-playlist-light a.wp-playlist-caption:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover a, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus a, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:hover, +.colors-custom .site-content .wp-playlist-light .wp-playlist-item:focus, +.colors-custom .prev.page-numbers:focus, +.colors-custom .prev.page-numbers:hover, +.colors-custom .next.page-numbers:focus, +.colors-custom .next.page-numbers:hover, +.colors-custom.has-header-image .site-title, +.colors-custom.has-header-video .site-title, +.colors-custom.has-header-image .site-title a, +.colors-custom.has-header-video .site-title a, +.colors-custom.has-header-image .site-description, +.colors-custom.has-header-video .site-description { + color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ +} + +body.colors-custom, +.colors-custom .navigation-top, +.colors-custom .main-navigation ul { + background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ +} + +.colors-custom .widget ul li a, +.colors-custom .site-footer .widget-area ul li a { + -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ + box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: rgba(255, 255, 255, 1); */ +} + +.colors-custom .menu-toggle, +.colors-custom .menu-toggle:hover, +.colors-custom .menu-toggle:focus, +.colors-custom .menu .dropdown-toggle, +.colors-custom .menu-scroll-down, +.colors-custom .menu-scroll-down:hover, +.colors-custom .menu-scroll-down:focus { + background-color: transparent; +} + +.colors-custom .widget .tagcloud a, +.colors-custom .widget .tagcloud a:focus, +.colors-custom .widget .tagcloud a:hover, +.colors-custom .widget.widget_tag_cloud a, +.colors-custom .widget.widget_tag_cloud a:focus, +.colors-custom .widget.widget_tag_cloud a:hover, +.colors-custom .wp_widget_tag_cloud a, +.colors-custom .wp_widget_tag_cloud a:focus, +.colors-custom .wp_widget_tag_cloud a:hover, +.colors-custom .entry-footer .edit-link a.post-edit-link:focus, +.colors-custom .entry-footer .edit-link a.post-edit-link:hover { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +/* Reset non-customizable hover styling for links */ +.colors-custom .entry-content a:hover, +.colors-custom .entry-content a:focus, +.colors-custom .entry-summary a:hover, +.colors-custom .entry-summary a:focus, +.colors-custom .widget a:hover, +.colors-custom .widget a:focus, +.colors-custom .site-footer .widget-area a:hover, +.colors-custom .site-footer .widget-area a:focus, +.colors-custom .posts-navigation a:hover, +.colors-custom .posts-navigation a:focus, +.colors-custom .widget_authors a:hover strong, +.colors-custom .widget_authors a:focus strong { + -webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); + box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 3px 0 rgba(0, 0, 0, 1); +} + +.colors-custom .gallery-item a, +.colors-custom .gallery-item a:hover, +.colors-custom .gallery-item a:focus { + -webkit-box-shadow: none; + box-shadow: none; +} + +@media screen and (min-width: 48em) { + + .colors-custom .nav-links .nav-previous .nav-title .icon, + .colors-custom .nav-links .nav-next .nav-title .icon { + color: hsl( ' . $hue . ', ' . $saturation . ', 20% ); /* base: #222; */ + } + + .colors-custom .main-navigation li li:hover, + .colors-custom .main-navigation li li.focus { + background: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */ + } + + .colors-custom .navigation-top .menu-scroll-down { + color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; + } + + .colors-custom abbr[title] { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 46% ); /* base: #767676; */; + } + + .colors-custom .main-navigation ul ul { + border-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ + background: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } + + .colors-custom .main-navigation ul li.menu-item-has-children:before, + .colors-custom .main-navigation ul li.page_item_has_children:before { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 73% ); /* base: #bbb; */ + } + + .colors-custom .main-navigation ul li.menu-item-has-children:after, + .colors-custom .main-navigation ul li.page_item_has_children:after { + border-bottom-color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } + + .colors-custom .main-navigation li li.focus > a, + .colors-custom .main-navigation li li:focus > a, + .colors-custom .main-navigation li li:hover > a, + .colors-custom .main-navigation li li a:hover, + .colors-custom .main-navigation li li a:focus, + .colors-custom .main-navigation li li.current_page_item a:hover, + .colors-custom .main-navigation li li.current-menu-item a:hover, + .colors-custom .main-navigation li li.current_page_item a:focus, + .colors-custom .main-navigation li li.current-menu-item a:focus { + color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */ + } +}'; + + /** + * Filters Twenty Seventeen custom colors CSS. + * + * @since Twenty Seventeen 1.0 + * + * @param string $css Base theme colors CSS. + * @param int $hue The user's selected color hue. + * @param string $saturation Filtered theme color saturation level. + */ + return apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation ); +} Index: site-template/themes/trunk/twentyseventeen/functions.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/functions.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/functions.php (revision 1409) @@ -0,0 +1,586 @@ + 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. + * + * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ + */ + add_theme_support( 'post-thumbnails' ); + + add_image_size( 'twentyseventeen-featured-image', 2000, 1200, true ); + + add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true ); + + // Set the default content width. + $GLOBALS['content_width'] = 525; + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( array( + 'top' => __( 'Top Menu', 'twentyseventeen' ), + 'social' => __( 'Social Links Menu', 'twentyseventeen' ), + ) ); + + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( 'html5', array( + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) ); + + /* + * Enable support for Post Formats. + * + * See: https://codex.wordpress.org/Post_Formats + */ + add_theme_support( 'post-formats', array( + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'audio', + ) ); + + // Add theme support for Custom Logo. + add_theme_support( 'custom-logo', array( + 'width' => 250, + 'height' => 250, + 'flex-width' => true, + ) ); + + // Add theme support for selective refresh for widgets. + add_theme_support( 'customize-selective-refresh-widgets' ); + + /* + * This theme styles the visual editor to resemble the theme style, + * specifically font, colors, and column width. + */ + add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) ); + + // Define and register starter content to showcase the theme on new sites. + $starter_content = array( + 'widgets' => array( + // Place three core-defined widgets in the sidebar area. + 'sidebar-1' => array( + 'text_business_info', + 'search', + 'text_about', + ), + + // Add the core-defined business info widget to the footer 1 area. + 'sidebar-2' => array( + 'text_business_info', + ), + + // Put two core-defined widgets in the footer 2 area. + 'sidebar-3' => array( + 'text_about', + 'search', + ), + ), + + // Specify the core-defined pages to create and add custom thumbnails to some of them. + 'posts' => array( + 'home', + 'about' => array( + 'thumbnail' => '{{image-sandwich}}', + ), + 'contact' => array( + 'thumbnail' => '{{image-espresso}}', + ), + 'blog' => array( + 'thumbnail' => '{{image-coffee}}', + ), + 'homepage-section' => array( + 'thumbnail' => '{{image-espresso}}', + ), + ), + + // Create the custom image attachments used as post thumbnails for pages. + 'attachments' => array( + 'image-espresso' => array( + 'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/espresso.jpg', // URL relative to the template directory. + ), + 'image-sandwich' => array( + 'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/sandwich.jpg', + ), + 'image-coffee' => array( + 'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ), + 'file' => 'assets/images/coffee.jpg', + ), + ), + + // Default to a static front page and assign the front and posts pages. + 'options' => array( + 'show_on_front' => 'page', + 'page_on_front' => '{{home}}', + 'page_for_posts' => '{{blog}}', + ), + + // Set the front page section theme mods to the IDs of the core-registered pages. + 'theme_mods' => array( + 'panel_1' => '{{homepage-section}}', + 'panel_2' => '{{about}}', + 'panel_3' => '{{blog}}', + 'panel_4' => '{{contact}}', + ), + + // Set up nav menus for each of the two areas registered in the theme. + 'nav_menus' => array( + // Assign a menu to the "top" location. + 'top' => array( + 'name' => __( 'Top Menu', 'twentyseventeen' ), + 'items' => array( + 'link_home', // Note that the core "home" page is actually a link in case a static front page is not used. + 'page_about', + 'page_blog', + 'page_contact', + ), + ), + + // Assign a menu to the "social" location. + 'social' => array( + 'name' => __( 'Social Links Menu', 'twentyseventeen' ), + 'items' => array( + 'link_yelp', + 'link_facebook', + 'link_twitter', + 'link_instagram', + 'link_email', + ), + ), + ), + ); + + /** + * Filters Twenty Seventeen array of starter content. + * + * @since Twenty Seventeen 1.1 + * + * @param array $starter_content Array of starter content. + */ + $starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content ); + + add_theme_support( 'starter-content', $starter_content ); +} +add_action( 'after_setup_theme', 'twentyseventeen_setup' ); + +/** + * Set the content width in pixels, based on the theme's design and stylesheet. + * + * Priority 0 to make it available to lower priority callbacks. + * + * @global int $content_width + */ +function twentyseventeen_content_width() { + + $content_width = $GLOBALS['content_width']; + + // Get layout. + $page_layout = get_theme_mod( 'page_layout' ); + + // Check if layout is one column. + if ( 'one-column' === $page_layout ) { + if ( twentyseventeen_is_frontpage() ) { + $content_width = 644; + } elseif ( is_page() ) { + $content_width = 740; + } + } + + // Check if is single post and there is no sidebar. + if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) { + $content_width = 740; + } + + /** + * Filter Twenty Seventeen content width of the theme. + * + * @since Twenty Seventeen 1.0 + * + * @param int $content_width Content width in pixels. + */ + $GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width ); +} +add_action( 'template_redirect', 'twentyseventeen_content_width', 0 ); + +/** + * Register custom fonts. + */ +function twentyseventeen_fonts_url() { + $fonts_url = ''; + + /* + * Translators: If there are characters in your language that are not + * supported by Libre Franklin, translate this to 'off'. Do not translate + * into your own language. + */ + $libre_franklin = _x( 'on', 'Libre Franklin font: on or off', 'twentyseventeen' ); + + if ( 'off' !== $libre_franklin ) { + $font_families = array(); + + $font_families[] = 'Libre Franklin:300,300i,400,400i,600,600i,800,800i'; + + $query_args = array( + 'family' => urlencode( implode( '|', $font_families ) ), + 'subset' => urlencode( 'latin,latin-ext' ), + ); + + $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + } + + return esc_url_raw( $fonts_url ); +} + +/** + * Add preconnect for Google Fonts. + * + * @since Twenty Seventeen 1.0 + * + * @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 twentyseventeen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentyseventeen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 ); + +/** + * Register widget area. + * + * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar + */ +function twentyseventeen_widgets_init() { + register_sidebar( array( + 'name' => __( 'Blog Sidebar', 'twentyseventeen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'twentyseventeen' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => __( 'Footer 1', 'twentyseventeen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) ); + + register_sidebar( array( + 'name' => __( 'Footer 2', 'twentyseventeen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Add widgets here to appear in your footer.', 'twentyseventeen' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) ); +} +add_action( 'widgets_init', 'twentyseventeen_widgets_init' ); + +/** + * Replaces "[...]" (appended to automatically generated excerpts) with ... and + * a 'Continue reading' link. + * + * @since Twenty Seventeen 1.0 + * + * @param string $link Link to single post/page. + * @return string 'Continue reading' link prepended with an ellipsis. + */ +function twentyseventeen_excerpt_more( $link ) { + if ( is_admin() ) { + return $link; + } + + $link = sprintf( '', + esc_url( get_permalink( get_the_ID() ) ), + /* translators: %s: Name of current post */ + sprintf( __( 'Continue reading "%s"', 'twentyseventeen' ), get_the_title( get_the_ID() ) ) + ); + return ' … ' . $link; +} +add_filter( 'excerpt_more', 'twentyseventeen_excerpt_more' ); + +/** + * Handles JavaScript detection. + * + * Adds a `js` class to the root `` element when JavaScript is detected. + * + * @since Twenty Seventeen 1.0 + */ +function twentyseventeen_javascript_detection() { + echo "\n"; +} +add_action( 'wp_head', 'twentyseventeen_javascript_detection', 0 ); + +/** + * Add a pingback url auto-discovery header for singularly identifiable articles. + */ +function twentyseventeen_pingback_header() { + if ( is_singular() && pings_open() ) { + printf( '' . "\n", get_bloginfo( 'pingback_url' ) ); + } +} +add_action( 'wp_head', 'twentyseventeen_pingback_header' ); + +/** + * Display custom color CSS. + */ +function twentyseventeen_colors_css_wrap() { + if ( 'custom' !== get_theme_mod( 'colorscheme' ) && ! is_customize_preview() ) { + return; + } + + require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) ); + $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) ); +?> + + twentyseventeen_get_svg( array( 'icon' => 'quote-right' ) ), + ); + + if ( has_nav_menu( 'top' ) ) { + wp_enqueue_script( 'twentyseventeen-navigation', get_theme_file_uri( '/assets/js/navigation.js' ), array( 'jquery' ), '1.0', true ); + $twentyseventeen_l10n['expand'] = __( 'Expand child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['collapse'] = __( 'Collapse child menu', 'twentyseventeen' ); + $twentyseventeen_l10n['icon'] = twentyseventeen_get_svg( array( 'icon' => 'angle-down', 'fallback' => true ) ); + } + + wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '1.0', true ); + + wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.2', true ); + + wp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n ); + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } +} +add_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' ); + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for content images. + * + * @since Twenty Seventeen 1.0 + * + * @param string $sizes A source size value for use in a 'sizes' attribute. + * @param array $size Image size. Accepts an array of width and height + * values in pixels (in that order). + * @return string A source size value for use in a content image 'sizes' attribute. + */ +function twentyseventeen_content_image_sizes_attr( $sizes, $size ) { + $width = $size[0]; + + if ( 740 <= $width ) { + $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px'; + } + + if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) { + if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) { + $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; + } + } + + return $sizes; +} +add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 ); + +/** + * Filter the `sizes` value in the header image markup. + * + * @since Twenty Seventeen 1.0 + * + * @param string $html The HTML image tag markup being filtered. + * @param object $header The custom header object returned by 'get_custom_header()'. + * @param array $attr Array of the attributes for the image tag. + * @return string The filtered header image HTML. + */ +function twentyseventeen_header_image_tag( $html, $header, $attr ) { + if ( isset( $attr['sizes'] ) ) { + $html = str_replace( $attr['sizes'], '100vw', $html ); + } + return $html; +} +add_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 ); + +/** + * Add custom image sizes attribute to enhance responsive image functionality + * for post thumbnails. + * + * @since Twenty Seventeen 1.0 + * + * @param array $attr Attributes for the image markup. + * @param int $attachment Image attachment ID. + * @param array $size Registered image size or flat array of height and width dimensions. + * @return array The filtered attributes for the image markup. + */ +function twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { + if ( is_archive() || is_search() || is_home() ) { + $attr['sizes'] = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px'; + } else { + $attr['sizes'] = '100vw'; + } + + return $attr; +} +add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr', 10, 3 ); + +/** + * Use front-page.php when Front page displays is set to a static page. + * + * @since Twenty Seventeen 1.0 + * + * @param string $template front-page.php. + * + * @return string The template to be used: blank if is_home() is true (defaults to index.php), else $template. + */ +function twentyseventeen_front_page_template( $template ) { + return is_home() ? '' : $template; +} +add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' ); + +/** + * Modifies tag cloud widget arguments to display all tags in the same font size + * and use list format for better accessibility. + * + * @since Twenty Seventeen 1.4 + * + * @param array $args Arguments for tag cloud widget. + * @return array The filtered arguments for tag cloud widget. + */ +function twentyseventeen_widget_tag_cloud_args( $args ) { + $args['largest'] = 1; + $args['smallest'] = 1; + $args['unit'] = 'em'; + $args['format'] = 'list'; + + return $args; +} +add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' ); + +/** + * Implement the Custom Header feature. + */ +require get_parent_theme_file_path( '/inc/custom-header.php' ); + +/** + * Custom template tags for this theme. + */ +require get_parent_theme_file_path( '/inc/template-tags.php' ); + +/** + * Additional features to allow styling of the templates. + */ +require get_parent_theme_file_path( '/inc/template-functions.php' ); + +/** + * Customizer additions. + */ +require get_parent_theme_file_path( '/inc/customizer.php' ); + +/** + * SVG icons functions and filters. + */ +require get_parent_theme_file_path( '/inc/icon-functions.php' ); Index: site-template/themes/trunk/twentyseventeen/assets/images/svg-icons.svg =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/images/svg-icons.svg (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/images/svg-icons.svg (revision 1409) @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: site-template/themes/trunk/twentyseventeen/template-parts/page/content-front-page-panels.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/template-parts/page/content-front-page-panels.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/template-parts/page/content-front-page-panels.php (revision 1409) @@ -0,0 +1,79 @@ + + +
> + + ID ), 'twentyseventeen-featured-image' ); + + // Calculate aspect ratio: h / w * 100%. + $ratio = $thumbnail[2] / $thumbnail[1] * 100; + ?> + +
+
+
+ + + +
+
+
+ ', '' ); ?> + + + +
+ +
+ "%s"', 'twentyseventeen' ), + get_the_title() + ) ); + ?> +
+ + + + 3, + 'post_status' => 'publish', + 'ignore_sticky_posts' => true, + 'no_found_rows' => true, + ) ); + ?> + + have_posts() ) : ?> + +
+ + have_posts() ) : $recent_posts->the_post(); + get_template_part( 'template-parts/post/content', 'excerpt' ); + endwhile; + wp_reset_postdata(); + ?> +
+ + + +
+
+ +
Index: site-template/themes/trunk/twentyseventeen/assets/css/ie9.css =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/assets/css/ie9.css (revision 0) +++ site-template/themes/trunk/twentyseventeen/assets/css/ie9.css (revision 1409) @@ -0,0 +1,43 @@ +/* +Theme Name: Twenty Seventeen +Description: IE9 specific styles. +*/ + +.has-header-image.twentyseventeen-front-page .custom-header, +.has-header-video.twentyseventeen-front-page .custom-header, +.has-header-image.home.blog .custom-header, +.has-header-video.home.blog .custom-header { + height: 300px; +} + +.has-header-image .custom-header-media img, +.has-header-video .custom-header-media video, +.has-header-video .custom-header-media iframe { + min-width: 100%; +} + +@media screen and (min-width: 30em) { + + .has-header-image.twentyseventeen-front-page .custom-header, + .has-header-video.twentyseventeen-front-page .custom-header, + .has-header-image.home.blog .custom-header, + .has-header-video.home.blog .custom-header, + .twentyseventeen-front-page.has-header-image .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .panel-image { + height: 700px; + } +} + +@media screen and (min-width: 48em) { + + .has-header-image.twentyseventeen-front-page .custom-header, + .has-header-video.twentyseventeen-front-page .custom-header, + .has-header-image.home.blog .custom-header, + .has-header-video.home.blog .custom-header, + .twentyseventeen-front-page.has-header-image .custom-header-media, + .home.blog.has-header-image .custom-header-media, + .panel-image { + height: 1000px; + } +} Index: site-template/themes/trunk/twentyseventeen/inc/custom-header.php =================================================================== diff -u --- site-template/themes/trunk/twentyseventeen/inc/custom-header.php (revision 0) +++ site-template/themes/trunk/twentyseventeen/inc/custom-header.php (revision 1409) @@ -0,0 +1,123 @@ + get_parent_theme_file_uri( '/assets/images/header.jpg' ), + 'width' => 2000, + 'height' => 1200, + 'flex-height' => true, + 'video' => true, + 'wp-head-callback' => 'twentyseventeen_header_style', + ) ) ); + + register_default_headers( array( + 'default-image' => array( + 'url' => '%s/assets/images/header.jpg', + 'thumbnail_url' => '%s/assets/images/header.jpg', + 'description' => __( 'Default Header Image', 'twentyseventeen' ), + ), + ) ); +} +add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); + +if ( ! function_exists( 'twentyseventeen_header_style' ) ) : +/** + * Styles the header image and text displayed on the blog. + * + * @see twentyseventeen_custom_header_setup(). + */ +function twentyseventeen_header_style() { + $header_text_color = get_header_textcolor(); + + // If no custom options for text are set, let's bail. + // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. + if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { + return; + } + + // If we get this far, we have custom styles. Let's do this. + ?> + + ' . __( 'Play background video', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); + $settings['l10n']['pause'] = '' . __( 'Pause background video', 'twentyseventeen' ) . '' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) ); + return $settings; +} +add_filter( 'header_video_settings', 'twentyseventeen_video_controls' );