Ticket #39152: 39152.diff
| File 39152.diff, 35.4 KB (added by , 10 years ago) |
|---|
-
src/wp-content/themes/twentyseventeen/comments.php
30 30 if ( have_comments() ) : ?> 31 31 <h2 class="comments-title"> 32 32 <?php 33 $comments_number = get_comments_number();34 if ( '1' === $comments_number ) {35 /* translators: %s: post title */36 printf( _x( 'One Reply to “%s”', 'comments title', 'twentyseventeen' ), get_the_title() );37 } else {38 printf(39 /* translators: 1: number of comments, 2: post title */40 _nx(41 '%1$s Reply to “%2$s”',42 '%1$s Replies to “%2$s”',43 $comments_number,44 'comments title',45 'twentyseventeen'46 ),47 number_format_i18n( $comments_number ),48 get_the_title()49 );50 }33 $comments_number = get_comments_number(); 34 if ( '1' === $comments_number ) { 35 /* translators: %s: post title */ 36 printf( _x( 'One Reply to “%s”', 'comments title', 'twentyseventeen' ), get_the_title() ); 37 } else { 38 printf( 39 /* translators: 1: number of comments, 2: post title */ 40 _nx( 41 '%1$s Reply to “%2$s”', 42 '%1$s Replies to “%2$s”', 43 $comments_number, 44 'comments title', 45 'twentyseventeen' 46 ), 47 number_format_i18n( $comments_number ), 48 get_the_title() 49 ); 50 } 51 51 ?> 52 52 </h2> 53 53 -
src/wp-content/themes/twentyseventeen/functions.php
310 310 * 311 311 * @since Twenty Seventeen 1.0 312 312 * 313 * @param string $link Link to single post/page 313 314 * @return string 'Continue reading' link prepended with an ellipsis. 314 315 */ 315 316 function twentyseventeen_excerpt_more( $link ) { -
src/wp-content/themes/twentyseventeen/inc/color-patterns.php
95 95 .colors-custom .site-footer .widget-area a, 96 96 .colors-custom .posts-navigation a, 97 97 .colors-custom .widget_authors a strong { 98 -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */98 -webkit-box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */ 99 99 box-shadow: inset 0 -1px 0 hsl( ' . $hue . ', ' . $saturation . ', 6% ); /* base: rgba(15, 15, 15, 1); */ 100 100 } 101 101 … … 201 201 .colors-custom .widget ul li a:focus, 202 202 .colors-custom .widget ul li a:hover { 203 203 -webkit-box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ); 204 box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% );204 box-shadow: inset 0 0 0 hsl( ' . $hue . ', ' . $saturation . ' , 13% ), 0 3px 0 hsl( ' . $hue . ', ' . $saturation . ', 13% ); 205 205 } 206 206 207 207 body.colors-custom, … … 560 560 } 561 561 }'; 562 562 563 564 563 /** 565 564 * Filters Twenty Seventeen custom colors CSS. 566 565 * -
src/wp-content/themes/twentyseventeen/inc/custom-header.php
53 53 add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); 54 54 55 55 if ( ! function_exists( 'twentyseventeen_header_style' ) ) : 56 /**57 * Styles the header image and text displayed on the blog.58 *59 * @see twentyseventeen_custom_header_setup().60 */61 function twentyseventeen_header_style() {62 $header_text_color = get_header_textcolor();56 /** 57 * Styles the header image and text displayed on the blog. 58 * 59 * @see twentyseventeen_custom_header_setup(). 60 */ 61 function twentyseventeen_header_style() { 62 $header_text_color = get_header_textcolor(); 63 63 64 // If no custom options for text are set, let's bail. 65 // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. 66 if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { 67 return; 64 // If no custom options for text are set, let's bail. 65 // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. 66 if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { 67 return; 68 } 69 70 // If we get this far, we have custom styles. Let's do this. 71 ?> 72 <style id="twentyseventeen-custom-header-styles" type="text/css"> 73 <?php 74 // Has the text been hidden? 75 if ( 'blank' === $header_text_color ) : 76 ?> 77 .site-title, 78 .site-description { 79 position: absolute; 80 clip: rect(1px, 1px, 1px, 1px); 81 } 82 <?php 83 // If the user has set a custom color for the text use that. 84 else : 85 ?> 86 .site-title a, 87 .colors-dark .site-title a, 88 .colors-custom .site-title a, 89 body.has-header-image .site-title a, 90 body.has-header-video .site-title a, 91 body.has-header-image.colors-dark .site-title a, 92 body.has-header-video.colors-dark .site-title a, 93 body.has-header-image.colors-custom .site-title a, 94 body.has-header-video.colors-custom .site-title a, 95 .site-description, 96 .colors-dark .site-description, 97 .colors-custom .site-description, 98 body.has-header-image .site-description, 99 body.has-header-video .site-description, 100 body.has-header-image.colors-dark .site-description, 101 body.has-header-video.colors-dark .site-description, 102 body.has-header-image.colors-custom .site-description, 103 body.has-header-video.colors-custom .site-description { 104 color: #<?php echo esc_attr( $header_text_color ); ?>; 105 } 106 <?php endif; ?> 107 </style> 108 <?php 68 109 } 69 70 // If we get this far, we have custom styles. Let's do this.71 ?>72 <style id="twentyseventeen-custom-header-styles" type="text/css">73 <?php74 // Has the text been hidden?75 if ( 'blank' === $header_text_color ) :76 ?>77 .site-title,78 .site-description {79 position: absolute;80 clip: rect(1px, 1px, 1px, 1px);81 }82 <?php83 // If the user has set a custom color for the text use that.84 else :85 ?>86 .site-title a,87 .colors-dark .site-title a,88 .colors-custom .site-title a,89 body.has-header-image .site-title a,90 body.has-header-video .site-title a,91 body.has-header-image.colors-dark .site-title a,92 body.has-header-video.colors-dark .site-title a,93 body.has-header-image.colors-custom .site-title a,94 body.has-header-video.colors-custom .site-title a,95 .site-description,96 .colors-dark .site-description,97 .colors-custom .site-description,98 body.has-header-image .site-description,99 body.has-header-video .site-description,100 body.has-header-image.colors-dark .site-description,101 body.has-header-video.colors-dark .site-description,102 body.has-header-image.colors-custom .site-description,103 body.has-header-video.colors-custom .site-description {104 color: #<?php echo esc_attr( $header_text_color ); ?>;105 }106 <?php endif; ?>107 </style>108 <?php109 }110 110 endif; // End of twentyseventeen_header_style. 111 111 112 112 /** 113 113 * Customize video play/pause button in the custom header. 114 * 115 * @param array $settings Video settings 114 116 */ 115 117 function twentyseventeen_video_controls( $settings ) { 116 118 $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); -
src/wp-content/themes/twentyseventeen/inc/customizer.php
123 123 124 124 /** 125 125 * Sanitize the page layout options. 126 * 127 * @param string $input Page layout 126 128 */ 127 129 function twentyseventeen_sanitize_page_layout( $input ) { 128 130 $valid = array( … … 139 141 140 142 /** 141 143 * Sanitize the colorscheme. 144 * @param string $input Color scheme 142 145 */ 143 146 function twentyseventeen_sanitize_colorscheme( $input ) { 144 147 $valid = array( 'light', 'dark', 'custom' ); 145 148 146 if ( in_array( $input, $valid ) ) {149 if ( in_array( $input, $valid, true ) ) { 147 150 return $input; 148 151 } 149 152 -
src/wp-content/themes/twentyseventeen/inc/template-tags.php
10 10 */ 11 11 12 12 if ( ! function_exists( 'twentyseventeen_posted_on' ) ) : 13 /**14 * Prints HTML with meta information for the current post-date/time and author.15 */16 function twentyseventeen_posted_on() {13 /** 14 * Prints HTML with meta information for the current post-date/time and author. 15 */ 16 function twentyseventeen_posted_on() { 17 17 18 // Get the author name; wrap it in a link.19 $byline = sprintf(20 /* translators: %s: post author */21 __( 'by %s', 'twentyseventeen' ),22 '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>'23 );18 // Get the author name; wrap it in a link. 19 $byline = sprintf( 20 /* translators: %s: post author */ 21 __( 'by %s', 'twentyseventeen' ), 22 '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' 23 ); 24 24 25 // Finally, let's write all of this to the page.26 echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>';27 }25 // Finally, let's write all of this to the page. 26 echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>'; 27 } 28 28 endif; 29 29 30 30 31 31 if ( ! function_exists( 'twentyseventeen_time_link' ) ) : 32 /**33 * Gets a nicely formatted string for the published date.34 */35 function twentyseventeen_time_link() {36 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';37 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {38 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';39 }32 /** 33 * Gets a nicely formatted string for the published date. 34 */ 35 function twentyseventeen_time_link() { 36 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; 37 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 38 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 39 } 40 40 41 $time_string = sprintf( $time_string,42 get_the_date( DATE_W3C ),43 get_the_date(),44 get_the_modified_date( DATE_W3C ),45 get_the_modified_date()46 );41 $time_string = sprintf( $time_string, 42 get_the_date( DATE_W3C ), 43 get_the_date(), 44 get_the_modified_date( DATE_W3C ), 45 get_the_modified_date() 46 ); 47 47 48 // Wrap the time string in a link, and preface it with 'Posted on'.49 return sprintf(50 /* translators: %s: post date */51 __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ),52 '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'53 );54 }48 // Wrap the time string in a link, and preface it with 'Posted on'. 49 return sprintf( 50 /* translators: %s: post date */ 51 __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ), 52 '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' 53 ); 54 } 55 55 endif; 56 56 57 57 58 58 if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : 59 /**60 * Prints HTML with meta information for the categories, tags and comments.61 */62 function twentyseventeen_entry_footer() {59 /** 60 * Prints HTML with meta information for the categories, tags and comments. 61 */ 62 function twentyseventeen_entry_footer() { 63 63 64 /* translators: used between list items, there is a space after the comma */65 $separate_meta = __( ', ', 'twentyseventeen' );64 /* translators: used between list items, there is a space after the comma */ 65 $separate_meta = __( ', ', 'twentyseventeen' ); 66 66 67 // Get Categories for posts.68 $categories_list = get_the_category_list( $separate_meta );67 // Get Categories for posts. 68 $categories_list = get_the_category_list( $separate_meta ); 69 69 70 // Get Tags for posts.71 $tags_list = get_the_tag_list( '', $separate_meta );70 // Get Tags for posts. 71 $tags_list = get_the_tag_list( '', $separate_meta ); 72 72 73 // We don't want to output .entry-footer if it will be empty, so make sure its not.74 if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {73 // We don't want to output .entry-footer if it will be empty, so make sure its not. 74 if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { 75 75 76 echo '<footer class="entry-footer">';76 echo '<footer class="entry-footer">'; 77 77 78 if ( 'post' === get_post_type() ) {79 if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) {80 echo '<span class="cat-tags-links">';78 if ( 'post' === get_post_type() ) { 79 if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) { 80 echo '<span class="cat-tags-links">'; 81 81 82 // Make sure there's more than one category before displaying.83 if ( $categories_list && twentyseventeen_categorized_blog() ) {84 echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>';85 }82 // Make sure there's more than one category before displaying. 83 if ( $categories_list && twentyseventeen_categorized_blog() ) { 84 echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; 85 } 86 86 87 if ( $tags_list ) {88 echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>';89 }87 if ( $tags_list ) { 88 echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; 89 } 90 90 91 echo '</span>'; 91 echo '</span>'; 92 } 92 93 } 93 }94 94 95 twentyseventeen_edit_link();95 twentyseventeen_edit_link(); 96 96 97 echo '</footer> <!-- .entry-footer -->'; 97 echo '</footer> <!-- .entry-footer -->'; 98 } 98 99 } 99 }100 100 endif; 101 101 102 102 103 103 if ( ! function_exists( 'twentyseventeen_edit_link' ) ) : 104 /**105 * Returns an accessibility-friendly link to edit a post or page.106 *107 * This also gives us a little context about what exactly we're editing108 * (post or page?) so that users understand a bit more where they are in terms109 * of the template hierarchy and their content. Helpful when/if the single-page110 * layout with multiple posts/pages shown gets confusing.111 */112 function twentyseventeen_edit_link() {104 /** 105 * Returns an accessibility-friendly link to edit a post or page. 106 * 107 * This also gives us a little context about what exactly we're editing 108 * (post or page?) so that users understand a bit more where they are in terms 109 * of the template hierarchy and their content. Helpful when/if the single-page 110 * layout with multiple posts/pages shown gets confusing. 111 */ 112 function twentyseventeen_edit_link() { 113 113 114 $link = edit_post_link(115 sprintf(116 /* translators: %s: Name of current post */117 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),118 get_the_title()119 ),120 '<span class="edit-link">',121 '</span>'122 );114 $link = edit_post_link( 115 sprintf( 116 /* translators: %s: Name of current post */ 117 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), 118 get_the_title() 119 ), 120 '<span class="edit-link">', 121 '</span>' 122 ); 123 123 124 return $link;125 }124 return $link; 125 } 126 126 endif; 127 127 128 128 /** 129 129 * Display a front page section. 130 130 * 131 * @param $partial WP_Customize_Partial Partial associated with a selective refresh request.132 * @param $id integerFront page section to display.131 * @param WP_Customize_Partial $partial Partial associated with a selective refresh request. 132 * @param integer $id Front page section to display. 133 133 */ 134 134 function twentyseventeen_front_page_section( $partial = null, $id = 0 ) { 135 135 if ( is_a( $partial, 'WP_Customize_Partial' ) ) { -
src/wp-content/themes/twentyseventeen/searchform.php
7 7 * @since 1.0 8 8 * @version 1.0 9 9 */ 10 10 11 ?> 11 12 12 13 <?php $unique_id = esc_attr( uniqid( 'search-form-' ) ); ?> -
src/wp-content/themes/twentyseventeen/single.php
17 17 <main id="main" class="site-main" role="main"> 18 18 19 19 <?php 20 /* Start the Loop */21 while ( have_posts() ) : the_post();20 /* Start the Loop */ 21 while ( have_posts() ) : the_post(); 22 22 23 get_template_part( 'template-parts/post/content', get_post_format() );23 get_template_part( 'template-parts/post/content', get_post_format() ); 24 24 25 // If comments are open or we have at least one comment, load up the comment template.26 if ( comments_open() || get_comments_number() ) :27 comments_template();28 endif;25 // If comments are open or we have at least one comment, load up the comment template. 26 if ( comments_open() || get_comments_number() ) : 27 comments_template(); 28 endif; 29 29 30 the_post_navigation( array(31 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>',32 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>',33 ) );30 the_post_navigation( array( 31 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>', 32 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>', 33 ) ); 34 34 35 endwhile; // End of the loop.35 endwhile; // End of the loop. 36 36 ?> 37 37 38 38 </main><!-- #main --> -
src/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php
21 21 <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> 22 22 <?php endif; ?> 23 23 24 <?php $description = get_bloginfo( 'description', 'display' ); 25 if ( $description || is_customize_preview() ) : ?> 26 <p class="site-description"><?php echo $description; ?></p> 27 <?php endif; ?> 24 <?php 25 $description = get_bloginfo( 'description', 'display' ); 26 27 if ( $description || is_customize_preview() ) : 28 ?> 29 <p class="site-description"><?php echo $description; ?></p> 30 <?php endif; ?> 28 31 </div><!-- .site-branding-text --> 29 32 30 33 <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && ! has_nav_menu( 'top' ) ) : ?> -
src/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php
10 10 11 11 ?> 12 12 <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php _e( 'Top Menu', 'twentyseventeen' ); ?>"> 13 <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"><?php echo twentyseventeen_get_svg( array( 'icon' => 'bars' ) ); echo twentyseventeen_get_svg( array( 'icon' => 'close' ) ); _e( 'Menu', 'twentyseventeen' ); ?></button> 13 <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"> 14 <?php 15 echo twentyseventeen_get_svg( array( 'icon' => 'bars' ) ); 16 echo twentyseventeen_get_svg( array( 'icon' => 'close' ) ); 17 _e( 'Menu', 'twentyseventeen' ); 18 ?> 19 </button> 20 14 21 <?php wp_nav_menu( array( 15 22 'theme_location' => 'top', 16 23 'menu_id' => 'top-menu', -
src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.
old new 14 14 15 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 16 16 <?php 17 if ( is_sticky() && is_home() ) :18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );19 endif;17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 20 20 ?> 21 21 <header class="entry-header"> 22 22 <?php 23 if ( 'post' === get_post_type() ) :24 echo '<div class="entry-meta">';25 if ( is_single() ) :26 twentyseventeen_posted_on();27 else :28 echo twentyseventeen_time_link();29 twentyseventeen_edit_link();30 endif;31 echo '</div><!-- .entry-meta -->';32 endif;23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 33 34 if ( is_single() ) {35 the_title( '<h1 class="entry-title">', '</h1>' );36 } else {37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );38 }34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } else { 37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 38 } 39 39 ?> 40 40 </header><!-- .entry-header --> 41 41 42 42 <?php 43 $content = apply_filters( 'the_content', get_the_content() );44 $audio = false;43 $content = apply_filters( 'the_content', get_the_content() ); 44 $audio = false; 45 45 46 // Only get audio from the content if a playlist isn't present. 47 if ( false === strpos( $content, 'wp-playlist-script' ) ) { 48 $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); 49 } 50 46 // Only get audio from the content if a playlist isn't present. 47 if ( false === strpos( $content, 'wp-playlist-script' ) ) { 48 $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); 49 } 51 50 ?> 52 51 53 52 <?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?> … … 60 59 61 60 <div class="entry-content"> 62 61 63 <?php if ( ! is_single() ) : 62 <?php 63 if ( !is_single() ) { 64 64 65 65 // If not a single post, highlight the audio file. 66 if ( ! empty( $audio ) ) :66 if ( ! empty( $audio ) ) { 67 67 foreach ( $audio as $audio_html ) { 68 68 echo '<div class="entry-audio">'; 69 69 echo $audio_html; 70 70 echo '</div><!-- .entry-audio -->'; 71 71 } 72 endif;72 }; 73 73 74 endif;74 } 75 75 76 if ( is_single() || empty( $audio ) ) :76 if ( is_single() || empty( $audio ) ) { 77 77 78 78 /* translators: %s: Name of current post */ 79 79 the_content( sprintf( … … 88 88 'link_after' => '</span>', 89 89 ) ); 90 90 91 endif; ?> 91 }; 92 ?> 92 93 93 94 </div><!-- .entry-content --> 94 95 95 <?php if ( is_single() ) : ?> 96 <?php twentyseventeen_entry_footer(); ?> 97 <?php endif; ?> 96 <?php 97 if ( is_single() ) { 98 twentyseventeen_entry_footer(); 99 } 100 ?> 98 101 99 </article><!-- #post-## --> 102 </article><!-- #post-## --> 103 No newline at end of file -
src/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php
9 9 * @since 1.0 10 10 * @version 1.0 11 11 */ 12 12 13 ?> 13 14 14 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 15 16 <?php 16 if ( is_sticky() && is_home() ) :17 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );18 endif;17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 19 20 ?> 20 21 <header class="entry-header"> 21 22 <?php 22 if ( 'post' === get_post_type() ) :23 echo '<div class="entry-meta">';24 if ( is_single() ) :25 twentyseventeen_posted_on();26 else :27 echo twentyseventeen_time_link();28 twentyseventeen_edit_link();29 endif;30 echo '</div><!-- .entry-meta -->';31 endif;23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 32 33 33 if ( is_single() ) {34 the_title( '<h1 class="entry-title">', '</h1>' );35 } else {36 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );37 }34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } else { 37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 38 } 38 39 ?> 39 40 </header><!-- .entry-header --> 40 41 … … 48 49 49 50 <div class="entry-content"> 50 51 51 <?php if ( ! is_single() ) : 52 <?php 53 if ( ! is_single() ) { 52 54 53 55 // If not a single post, highlight the gallery. 54 if ( get_post_gallery() ) :56 if ( get_post_gallery() ) { 55 57 echo '<div class="entry-gallery">'; 56 58 echo get_post_gallery(); 57 59 echo '</div>'; 58 endif;60 }; 59 61 60 endif;62 }; 61 63 62 if ( is_single() || ! get_post_gallery() ) :64 if ( is_single() || ! get_post_gallery() ) { 63 65 64 66 /* translators: %s: Name of current post */ 65 67 the_content( sprintf( … … 74 76 'link_after' => '</span>', 75 77 ) ); 76 78 77 endif; ?> 79 }; 80 ?> 78 81 79 82 </div><!-- .entry-content --> 80 83 81 <?php if ( is_single() ) : ?> 82 <?php twentyseventeen_entry_footer(); ?> 83 <?php endif; ?> 84 <?php 85 if ( is_single() ) { 86 twentyseventeen_entry_footer(); 87 } 88 ?> 84 89 85 90 </article><!-- #post-## --> -
src/wp-content/themes/twentyseventeen/template-parts/post/content-image.
old new 9 9 * @since 1.0 10 10 * @version 1.0 11 11 */ 12 12 13 ?> 13 14 14 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 15 16 <?php 16 if ( is_sticky() && is_home() ) :17 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );18 endif;17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 19 20 ?> 20 21 <header class="entry-header"> 21 22 <?php 22 if ( 'post' === get_post_type() ) :23 if ( 'post' === get_post_type() ) { 23 24 echo '<div class="entry-meta">'; 24 if ( is_single() ) :25 if ( is_single() ) { 25 26 twentyseventeen_posted_on(); 26 else :27 } else { 27 28 echo twentyseventeen_time_link(); 28 29 twentyseventeen_edit_link(); 29 endif;30 }; 30 31 echo '</div><!-- .entry-meta -->'; 31 endif;32 }; 32 33 33 34 if ( is_single() ) { 34 35 the_title( '<h1 class="entry-title">', '</h1>' ); … … 48 49 49 50 <div class="entry-content"> 50 51 51 <?php if ( is_single() || '' === get_the_post_thumbnail() ) : 52 <?php 53 if ( is_single() || '' === get_the_post_thumbnail() ) { 52 54 53 55 // Only show content if is a single post, or if there's no featured image. 54 56 /* translators: %s: Name of current post */ … … 64 66 'link_after' => '</span>', 65 67 ) ); 66 68 67 endif; ?> 69 } 70 ?> 68 71 69 72 </div><!-- .entry-content --> 70 73 71 <?php if ( is_single() ) : ?> 72 <?php twentyseventeen_entry_footer(); ?> 73 <?php endif; ?> 74 <?php 75 if ( is_single() ) { 76 twentyseventeen_entry_footer(); 77 } 78 ?> 74 79 75 80 </article><!-- #post-## --> -
src/wp-content/themes/twentyseventeen/template-parts/post/content-video.
old new 9 9 * @since 1.0 10 10 * @version 1.0 11 11 */ 12 12 13 ?> 13 14 14 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 15 16 <?php 16 if ( is_sticky() && is_home() ) :17 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );18 endif;17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 19 20 ?> 20 21 <header class="entry-header"> 21 22 <?php 22 if ( 'post' === get_post_type() ) :23 echo '<div class="entry-meta">';24 if ( is_single() ) :25 twentyseventeen_posted_on();26 else :27 echo twentyseventeen_time_link();28 twentyseventeen_edit_link();29 endif;30 echo '</div><!-- .entry-meta -->';31 endif;23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 32 33 33 if ( is_single() ) {34 the_title( '<h1 class="entry-title">', '</h1>' );35 } else {36 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );37 }34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } else { 37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 38 } 38 39 ?> 39 40 </header><!-- .entry-header --> 40 41 … … 58 59 59 60 <div class="entry-content"> 60 61 61 <?php if ( ! is_single() ) : 62 <?php 63 if ( ! is_single() ) { 62 64 63 65 // If not a single post, highlight the video file. 64 if ( ! empty( $video ) ) :66 if ( ! empty( $video ) ) { 65 67 foreach ( $video as $video_html ) { 66 68 echo '<div class="entry-video">'; 67 69 echo $video_html; 68 70 echo '</div>'; 69 71 } 70 endif;72 }; 71 73 72 endif;74 }; 73 75 74 if ( is_single() || empty( $video ) ) :76 if ( is_single() || empty( $video ) ) { 75 77 76 78 /* translators: %s: Name of current post */ 77 79 the_content( sprintf( … … 86 88 'link_after' => '</span>', 87 89 ) ); 88 90 89 endif; ?> 91 }; 92 ?> 90 93 91 94 </div><!-- .entry-content --> 92 95 93 <?php if ( is_single() ) : ?> 94 <?php twentyseventeen_entry_footer(); ?> 95 <?php endif; ?> 96 <?php 97 if ( is_single() ) { 98 twentyseventeen_entry_footer(); 99 } 100 ?> 96 101 97 102 </article><!-- #post-## --> -
src/wp-content/themes/twentyseventeen/template-parts/post/content.php
14 14 15 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 16 16 <?php 17 if ( is_sticky() && is_home() ) :18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );19 endif;17 if ( is_sticky() && is_home() ) : 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 endif; 20 20 ?> 21 21 <header class="entry-header"> 22 22 <?php 23 if ( 'post' === get_post_type() ) :24 echo '<div class="entry-meta">';25 if ( is_single() ) :26 twentyseventeen_posted_on();27 else :28 echo twentyseventeen_time_link();29 twentyseventeen_edit_link();30 endif;31 echo '</div><!-- .entry-meta -->';32 endif;23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 33 34 if ( is_single() ) {35 the_title( '<h1 class="entry-title">', '</h1>' );36 } else {37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );38 }34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } else { 37 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 38 } 39 39 ?> 40 40 </header><!-- .entry-header --> 41 41 … … 49 49 50 50 <div class="entry-content"> 51 51 <?php 52 /* translators: %s: Name of current post */53 the_content( sprintf(54 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),55 get_the_title()56 ) );52 /* translators: %s: Name of current post */ 53 the_content( sprintf( 54 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), 55 get_the_title() 56 ) ); 57 57 58 wp_link_pages( array(59 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),60 'after' => '</div>',61 'link_before' => '<span class="page-number">',62 'link_after' => '</span>',63 ) );58 wp_link_pages( array( 59 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), 60 'after' => '</div>', 61 'link_before' => '<span class="page-number">', 62 'link_after' => '</span>', 63 ) ); 64 64 ?> 65 65 </div><!-- .entry-content --> 66 66 67 <?php if ( is_single() ) : ?> 68 <?php twentyseventeen_entry_footer(); ?> 69 <?php endif; ?> 67 <?php 68 if ( is_single() ) { 69 twentyseventeen_entry_footer(); 70 } 71 ?> 70 72 71 73 </article><!-- #post-## -->
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)