Ticket #41057: 41057-src-wp-content.diff
File 41057-src-wp-content.diff, 325.2 KB (added by , 8 years ago) |
---|
-
src/wp-content/plugins/hello.php
79 79 80 80 add_action( 'admin_head', 'dolly_css' ); 81 81 82 ?> 82 -
src/wp-content/themes/twentyeleven/404.php
22 22 23 23 <?php get_search_form(); ?> 24 24 25 <?php the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 10 ), array( 'widget_id' => '404' ) ); ?> 25 <?php the_widget( 'WP_Widget_Recent_Posts', array( 26 'number' => 10, 27 ), array( 28 'widget_id' => '404', 29 ) ); ?> 26 30 27 31 <div class="widget"> 28 32 <h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2> 29 33 <ul> 30 <?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?> 34 <?php wp_list_categories( array( 35 'orderby' => 'count', 36 'order' => 'DESC', 37 'show_count' => 1, 38 'title_li' => '', 39 'number' => 10, 40 ) ); ?> 31 41 </ul> 32 42 </div> 33 43 34 44 <?php 35 45 /* translators: %1$s: smilie */ 36 46 $archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>'; 37 the_widget( 'WP_Widget_Archives', array( 'count' => 0, 'dropdown' => 1 ), array( 'after_title' => '</h2>' . $archive_content ) ); 47 the_widget( 'WP_Widget_Archives', array( 48 'count' => 0, 49 'dropdown' => 1, 50 ), array( 51 'after_title' => '</h2>' . $archive_content, 52 ) ); 38 53 ?> 39 54 40 55 <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?> … … 45 60 </div><!-- #content --> 46 61 </div><!-- #primary --> 47 62 48 <?php get_footer(); ?> 49 No newline at end of file 63 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/author.php
98 98 </section><!-- #primary --> 99 99 100 100 <?php get_sidebar(); ?> 101 <?php get_footer(); ?> 102 No newline at end of file 101 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/category.php
21 21 22 22 <?php 23 23 $category_description = category_description(); 24 25 24 if ( ! empty( $category_description ) ) { 25 /** 26 26 * Filter the default Twenty Eleven category description. 27 27 * 28 28 * @since Twenty Eleven 1.0 29 29 * 30 30 * @param string The default category description HTML. 31 31 */ 32 33 32 echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' ); 33 } 34 34 ?> 35 35 </header> 36 36 -
src/wp-content/themes/twentyeleven/comments.php
32 32 <h2 id="comments-title"> 33 33 <?php 34 34 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ), 35 35 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); 36 36 ?> 37 37 </h2> 38 38 … … 53 53 * define twentyeleven_comment() and that will be used instead. 54 54 * See twentyeleven_comment() in twentyeleven/functions.php for more. 55 55 */ 56 wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); 56 wp_list_comments( array( 57 'callback' => 'twentyeleven_comment', 58 ) ); 57 59 ?> 58 60 </ol> 59 61 -
src/wp-content/themes/twentyeleven/content-featured.php
20 20 21 21 <div class="entry-summary"> 22 22 <?php the_excerpt(); ?> 23 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 23 <?php wp_link_pages( array( 24 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 25 'after' => '</div>', 26 ) ); ?> 24 27 </div><!-- .entry-content --> 25 28 26 29 <footer class="entry-meta"> 27 30 <?php 28 31 /* translators: used between list items, there is a space after the comma */ 29 32 $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 30 31 32 33 34 33 if ( '' != $tag_list ) { 34 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); 35 } else { 36 $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); 37 } 35 38 printf( 36 39 $utility_text, 37 40 /* translators: used between list items, there is a space after the comma */ -
src/wp-content/themes/twentyeleven/content-image.php
27 27 28 28 <div class="entry-content"> 29 29 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> 30 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 30 <?php wp_link_pages( array( 31 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 32 'after' => '</div>', 33 ) ); ?> 31 34 </div><!-- .entry-content --> 32 35 33 36 <footer class="entry-meta"> … … 47 50 <?php 48 51 /* translators: used between list items, there is a space after the comma */ 49 52 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 50 if ( $categories_list ):53 if ( $categories_list ) : 51 54 ?> 52 55 <span class="cat-links"> 53 56 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?> 54 57 </span> 55 58 <?php endif; // End if categories ?> 56 59 <?php 57 60 /* translators: used between list items, there is a space after the comma */ 58 61 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 59 if ( $tags_list ): ?>62 if ( $tags_list ) : ?> 60 63 <span class="tag-links"> 61 64 <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> 62 65 </span> -
src/wp-content/themes/twentyeleven/content-intro.php
15 15 16 16 <div class="entry-content"> 17 17 <?php the_content(); ?> 18 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 18 <?php wp_link_pages( array( 19 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 20 'after' => '</div>', 21 ) ); ?> 19 22 <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> 20 23 </div><!-- .entry-content --> 21 24 </article><!-- #post-<?php the_ID(); ?> --> -
src/wp-content/themes/twentyeleven/content-page.php
15 15 16 16 <div class="entry-content"> 17 17 <?php the_content(); ?> 18 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 18 <?php wp_link_pages( array( 19 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 20 'after' => '</div>', 21 ) ); ?> 19 22 </div><!-- .entry-content --> 20 23 <footer class="entry-meta"> 21 24 <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> -
src/wp-content/themes/twentyeleven/content-quote.php
33 33 <?php else : ?> 34 34 <div class="entry-content"> 35 35 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> 36 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 36 <?php wp_link_pages( array( 37 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 38 'after' => '</div>', 39 ) ); ?> 37 40 </div><!-- .entry-content --> 38 41 <?php endif; ?> 39 42 … … 42 45 <?php 43 46 /* translators: used between list items, there is a space after the comma */ 44 47 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 45 if ( $categories_list ):48 if ( $categories_list ) : 46 49 ?> 47 50 <span class="cat-links"> 48 49 51 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); 52 $show_sep = true; ?> 50 53 </span> 51 54 <?php endif; // End if categories ?> 52 55 <?php 53 56 /* translators: used between list items, there is a space after the comma */ 54 57 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 55 if ( $tags_list ):58 if ( $tags_list ) : 56 59 if ( $show_sep ) : ?> 57 60 <span class="sep"> | </span> 58 61 <?php endif; // End if $show_sep ?> -
src/wp-content/themes/twentyeleven/content-single.php
31 31 32 32 /* translators: used between list items, there is a space after the comma */ 33 33 $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 34 35 36 37 38 39 40 34 if ( '' != $tag_list ) { 35 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); 36 } elseif ( '' != $categories_list ) { 37 $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); 38 } else { 39 $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' ); 40 } 41 41 42 42 printf( 43 43 $utility_text, -
src/wp-content/themes/twentyeleven/content.php
39 39 <?php else : ?> 40 40 <div class="entry-content"> 41 41 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> 42 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 42 <?php wp_link_pages( array( 43 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 44 'after' => '</div>', 45 ) ); ?> 43 46 </div><!-- .entry-content --> 44 47 <?php endif; ?> 45 48 … … 49 52 <?php 50 53 /* translators: used between list items, there is a space after the comma */ 51 54 $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); 52 if ( $categories_list ):55 if ( $categories_list ) : 53 56 ?> 54 57 <span class="cat-links"> 55 56 58 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); 59 $show_sep = true; ?> 57 60 </span> 58 61 <?php endif; // End if categories ?> 59 62 <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?> … … 61 64 <?php 62 65 /* translators: used between list items, there is a space after the comma */ 63 66 $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); 64 if ( $tags_list ):67 if ( $tags_list ) : 65 68 if ( $show_sep ) : ?> 66 69 <span class="sep"> | </span> 67 70 <?php endif; // End if $show_sep ?> -
src/wp-content/themes/twentyeleven/footer.php
19 19 * A sidebar in the footer? Yep. You can customize 20 20 * your footer with three columns of widgets. 21 21 */ 22 if ( ! is_404() ) 23 get_sidebar( 'footer' ); 22 if ( ! is_404() ) { 23 get_sidebar( 'footer' ); 24 } 24 25 ?> 25 26 26 27 <div id="site-generator"> … … 33 34 <?php wp_footer(); ?> 34 35 35 36 </body> 36 </html> 37 No newline at end of file 37 </html> -
src/wp-content/themes/twentyeleven/functions.php
39 39 */ 40 40 41 41 // Set the content width based on the theme's design and stylesheet. 42 if ( ! isset( $content_width ) ) 42 if ( ! isset( $content_width ) ) { 43 43 $content_width = 584; 44 } 44 45 45 46 /* 46 47 * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run. 47 48 */ 48 49 add_action( 'after_setup_theme', 'twentyeleven_setup' ); 49 50 50 if ( ! function_exists( 'twentyeleven_setup' ) ) :51 /**51 if ( ! function_exists( 'twentyeleven_setup' ) ) : 52 /** 52 53 * Set up theme defaults and registers support for various WordPress features. 53 54 * 54 55 * Note that this function is hooked into the after_setup_theme hook, which runs … … 68 69 * 69 70 * @since Twenty Eleven 1.0 70 71 */ 71 function twentyeleven_setup() { 72 73 /* 74 * Make Twenty Eleven available for translation. 75 * Translations can be added to the /languages/ directory. 76 * If you're building a theme based on Twenty Eleven, use 77 * a find and replace to change 'twentyeleven' to the name 78 * of your theme in all the template files. 79 */ 80 load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' ); 81 82 // This theme styles the visual editor with editor-style.css to match the theme style. 83 add_editor_style(); 84 85 // Load up our theme options page and related code. 86 require( get_template_directory() . '/inc/theme-options.php' ); 87 88 // Grab Twenty Eleven's Ephemera widget. 89 require( get_template_directory() . '/inc/widgets.php' ); 90 91 // Add default posts and comments RSS feed links to <head>. 92 add_theme_support( 'automatic-feed-links' ); 93 94 // This theme uses wp_nav_menu() in one location. 95 register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) ); 96 97 // Add support for a variety of post formats 98 add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) ); 99 100 $theme_options = twentyeleven_get_theme_options(); 101 if ( 'dark' == $theme_options['color_scheme'] ) 102 $default_background_color = '1d1d1d'; 103 else 104 $default_background_color = 'e2e2e2'; 72 function twentyeleven_setup() { 105 73 106 // Add support for custom backgrounds.107 add_theme_support( 'custom-background', array(108 74 /* 109 * Let WordPress know what our default background color is. 110 * This is dependent on our current color scheme. 75 * Make Twenty Eleven available for translation. 76 * Translations can be added to the /languages/ directory. 77 * If you're building a theme based on Twenty Eleven, use 78 * a find and replace to change 'twentyeleven' to the name 79 * of your theme in all the template files. 111 80 */ 112 'default-color' => $default_background_color, 113 ) ); 81 load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' ); 82 83 // This theme styles the visual editor with editor-style.css to match the theme style. 84 add_editor_style(); 85 86 // Load up our theme options page and related code. 87 require( get_template_directory() . '/inc/theme-options.php' ); 114 88 115 // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images 116 add_theme_support( 'post-thumbnails' ); 89 // Grab Twenty Eleven's Ephemera widget. 90 require( get_template_directory() . '/inc/widgets.php' ); 91 92 // Add default posts and comments RSS feed links to <head>. 93 add_theme_support( 'automatic-feed-links' ); 94 95 // This theme uses wp_nav_menu() in one location. 96 register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) ); 97 98 // Add support for a variety of post formats 99 add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) ); 100 101 $theme_options = twentyeleven_get_theme_options(); 102 if ( 'dark' == $theme_options['color_scheme'] ) { 103 $default_background_color = '1d1d1d'; 104 } else { $default_background_color = 'e2e2e2'; 105 } 117 106 118 // Add support for custom headers. 119 $custom_header_support = array( 120 // The default header text color. 121 'default-text-color' => '000', 122 // The height and width of our custom header. 123 /** 107 // Add support for custom backgrounds. 108 add_theme_support( 'custom-background', array( 109 /* 110 * Let WordPress know what our default background color is. 111 * This is dependent on our current color scheme. 112 */ 113 'default-color' => $default_background_color, 114 ) ); 115 116 // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images 117 add_theme_support( 'post-thumbnails' ); 118 119 // Add support for custom headers. 120 $custom_header_support = array( 121 // The default header text color. 122 'default-text-color' => '000', 123 // The height and width of our custom header. 124 /** 124 125 * Filter the Twenty Eleven default header image width. 125 126 * 126 127 * @since Twenty Eleven 1.0 127 128 * 128 129 * @param int The default header image width in pixels. Default 1000. 129 130 */ 130 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),131 /**131 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ), 132 /** 132 133 * Filter the Twenty Eleven default header image height. 133 134 * 134 135 * @since Twenty Eleven 1.0 135 136 * 136 137 * @param int The default header image height in pixels. Default 288. 137 138 */ 138 'height' => apply_filters( 'twentyeleven_header_image_height', 288 ), 139 // Support flexible heights. 140 'flex-height' => true, 141 // Random image rotation by default. 142 'random-default' => true, 143 // Callback for styling the header. 144 'wp-head-callback' => 'twentyeleven_header_style', 145 // Callback for styling the header preview in the admin. 146 'admin-head-callback' => 'twentyeleven_admin_header_style', 147 // Callback used to display the header preview in the admin. 148 'admin-preview-callback' => 'twentyeleven_admin_header_image', 149 ); 150 151 add_theme_support( 'custom-header', $custom_header_support ); 152 153 if ( ! function_exists( 'get_custom_header' ) ) { 154 // This is all for compatibility with versions of WordPress prior to 3.4. 155 define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] ); 156 define( 'HEADER_IMAGE', '' ); 157 define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); 158 define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); 159 add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] ); 160 add_custom_background(); 161 } 162 163 /* 164 * We'll be using post thumbnails for custom header images on posts and pages. 165 * We want them to be the size of the header image that we just defined. 166 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 167 */ 168 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); 169 170 /* 171 * Add Twenty Eleven's custom image sizes. 172 * Used for large feature (header) images. 173 */ 174 add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true ); 175 // Used for featured posts if a large-feature doesn't exist. 176 add_image_size( 'small-feature', 500, 300 ); 177 178 // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. 179 register_default_headers( array( 180 'wheel' => array( 181 'url' => '%s/images/headers/wheel.jpg', 182 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 183 /* translators: header image description */ 184 'description' => __( 'Wheel', 'twentyeleven' ) 185 ), 186 'shore' => array( 187 'url' => '%s/images/headers/shore.jpg', 188 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', 189 /* translators: header image description */ 190 'description' => __( 'Shore', 'twentyeleven' ) 191 ), 192 'trolley' => array( 193 'url' => '%s/images/headers/trolley.jpg', 194 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', 195 /* translators: header image description */ 196 'description' => __( 'Trolley', 'twentyeleven' ) 197 ), 198 'pine-cone' => array( 199 'url' => '%s/images/headers/pine-cone.jpg', 200 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', 201 /* translators: header image description */ 202 'description' => __( 'Pine Cone', 'twentyeleven' ) 203 ), 204 'chessboard' => array( 205 'url' => '%s/images/headers/chessboard.jpg', 206 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', 207 /* translators: header image description */ 208 'description' => __( 'Chessboard', 'twentyeleven' ) 209 ), 210 'lanterns' => array( 211 'url' => '%s/images/headers/lanterns.jpg', 212 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', 213 /* translators: header image description */ 214 'description' => __( 'Lanterns', 'twentyeleven' ) 215 ), 216 'willow' => array( 217 'url' => '%s/images/headers/willow.jpg', 218 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', 219 /* translators: header image description */ 220 'description' => __( 'Willow', 'twentyeleven' ) 221 ), 222 'hanoi' => array( 223 'url' => '%s/images/headers/hanoi.jpg', 224 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', 225 /* translators: header image description */ 226 'description' => __( 'Hanoi Plant', 'twentyeleven' ) 227 ) 228 ) ); 139 'height' => apply_filters( 'twentyeleven_header_image_height', 288 ), 140 // Support flexible heights. 141 'flex-height' => true, 142 // Random image rotation by default. 143 'random-default' => true, 144 // Callback for styling the header. 145 'wp-head-callback' => 'twentyeleven_header_style', 146 // Callback for styling the header preview in the admin. 147 'admin-head-callback' => 'twentyeleven_admin_header_style', 148 // Callback used to display the header preview in the admin. 149 'admin-preview-callback' => 'twentyeleven_admin_header_image', 150 ); 151 152 add_theme_support( 'custom-header', $custom_header_support ); 153 154 if ( ! function_exists( 'get_custom_header' ) ) { 155 // This is all for compatibility with versions of WordPress prior to 3.4. 156 define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] ); 157 define( 'HEADER_IMAGE', '' ); 158 define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); 159 define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); 160 add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] ); 161 add_custom_background(); 162 } 229 163 230 // Indicate widget sidebars can use selective refresh in the Customizer. 231 add_theme_support( 'customize-selective-refresh-widgets' ); 232 } 164 /* 165 * We'll be using post thumbnails for custom header images on posts and pages. 166 * We want them to be the size of the header image that we just defined. 167 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 168 */ 169 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); 170 171 /* 172 * Add Twenty Eleven's custom image sizes. 173 * Used for large feature (header) images. 174 */ 175 add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true ); 176 // Used for featured posts if a large-feature doesn't exist. 177 add_image_size( 'small-feature', 500, 300 ); 178 179 // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. 180 register_default_headers( array( 181 'wheel' => array( 182 'url' => '%s/images/headers/wheel.jpg', 183 'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg', 184 /* translators: header image description */ 185 'description' => __( 'Wheel', 'twentyeleven' ), 186 ), 187 'shore' => array( 188 'url' => '%s/images/headers/shore.jpg', 189 'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg', 190 /* translators: header image description */ 191 'description' => __( 'Shore', 'twentyeleven' ), 192 ), 193 'trolley' => array( 194 'url' => '%s/images/headers/trolley.jpg', 195 'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg', 196 /* translators: header image description */ 197 'description' => __( 'Trolley', 'twentyeleven' ), 198 ), 199 'pine-cone' => array( 200 'url' => '%s/images/headers/pine-cone.jpg', 201 'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg', 202 /* translators: header image description */ 203 'description' => __( 'Pine Cone', 'twentyeleven' ), 204 ), 205 'chessboard' => array( 206 'url' => '%s/images/headers/chessboard.jpg', 207 'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg', 208 /* translators: header image description */ 209 'description' => __( 'Chessboard', 'twentyeleven' ), 210 ), 211 'lanterns' => array( 212 'url' => '%s/images/headers/lanterns.jpg', 213 'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg', 214 /* translators: header image description */ 215 'description' => __( 'Lanterns', 'twentyeleven' ), 216 ), 217 'willow' => array( 218 'url' => '%s/images/headers/willow.jpg', 219 'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg', 220 /* translators: header image description */ 221 'description' => __( 'Willow', 'twentyeleven' ), 222 ), 223 'hanoi' => array( 224 'url' => '%s/images/headers/hanoi.jpg', 225 'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg', 226 /* translators: header image description */ 227 'description' => __( 'Hanoi Plant', 'twentyeleven' ), 228 ), 229 ) ); 230 231 // Indicate widget sidebars can use selective refresh in the Customizer. 232 add_theme_support( 'customize-selective-refresh-widgets' ); 233 } 233 234 endif; // twentyeleven_setup 234 235 235 236 if ( ! function_exists( 'twentyeleven_header_style' ) ) : 236 /**237 /** 237 238 * Styles the header image and text displayed on the blog. 238 239 * 239 240 * @since Twenty Eleven 1.0 240 241 */ 241 function twentyeleven_header_style() {242 $text_color = get_header_textcolor();242 function twentyeleven_header_style() { 243 $text_color = get_header_textcolor(); 243 244 244 // If no custom options for text are set, let's bail. 245 if ( $text_color == HEADER_TEXTCOLOR ) 246 return; 245 // If no custom options for text are set, let's bail. 246 if ( $text_color == HEADER_TEXTCOLOR ) { 247 return; 248 } 247 249 248 // If we get this far, we have custom styles. Let's do this.249 ?>250 <style type="text/css" id="twentyeleven-header-css">251 <?php250 // If we get this far, we have custom styles. Let's do this. 251 ?> 252 <style type="text/css" id="twentyeleven-header-css"> 253 <?php 252 254 // Has the text been hidden? 253 255 if ( 'blank' == $text_color ) : 254 256 ?> … … 269 271 <?php endif; ?> 270 272 </style> 271 273 <?php 272 }274 } 273 275 endif; // twentyeleven_header_style 274 276 275 277 if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) : 276 /**278 /** 277 279 * Styles the header image displayed on the Appearance > Header admin panel. 278 280 * 279 281 * Referenced via add_theme_support('custom-header') in twentyeleven_setup(). 280 282 * 281 283 * @since Twenty Eleven 1.0 282 284 */ 283 function twentyeleven_admin_header_style() {284 ?>285 <style type="text/css" id="twentyeleven-admin-header-css">286 .appearance_page_custom-header #headimg {285 function twentyeleven_admin_header_style() { 286 ?> 287 <style type="text/css" id="twentyeleven-admin-header-css"> 288 .appearance_page_custom-header #headimg { 287 289 border: none; 288 }289 #headimg h1,290 #desc {290 } 291 #headimg h1, 292 #desc { 291 293 font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; 292 }293 #headimg h1 {294 } 295 #headimg h1 { 294 296 margin: 0; 295 }296 #headimg h1 a {297 } 298 #headimg h1 a { 297 299 font-size: 32px; 298 300 line-height: 36px; 299 301 text-decoration: none; 300 }301 #desc {302 } 303 #desc { 302 304 font-size: 14px; 303 305 line-height: 23px; 304 306 padding: 0 0 3em; 305 }306 <?php307 } 308 <?php 307 309 // If the user has set a custom color for the text use that 308 310 if ( get_header_textcolor() != HEADER_TEXTCOLOR ) : 309 311 ?> 310 311 312 313 312 #site-title a, 313 #site-description { 314 color: #<?php echo get_header_textcolor(); ?>; 315 } 314 316 <?php endif; ?> 315 317 #headimg img { 316 318 max-width: 1000px; … … 318 320 width: 100%; 319 321 } 320 322 </style> 321 <?php322 }323 <?php 324 } 323 325 endif; // twentyeleven_admin_header_style 324 326 325 327 if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) : 326 /**328 /** 327 329 * Custom header image markup displayed on the Appearance > Header admin panel. 328 330 * 329 331 * Referenced via add_theme_support('custom-header') in twentyeleven_setup(). 330 332 * 331 333 * @since Twenty Eleven 1.0 332 334 */ 333 function twentyeleven_admin_header_image() { ?> 334 <div id="headimg"> 335 <?php 336 $color = get_header_textcolor(); 337 $image = get_header_image(); 338 $style = 'display: none;'; 339 if ( $color && $color != 'blank' ) { 340 $style = 'color: #' . $color . ';'; 341 } 342 ?> 343 <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> 344 <div id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></div> 345 <?php if ( $image ) : ?> 335 function twentyeleven_admin_header_image() { 336 ?> 337 <div id="headimg"> 338 <?php 339 $color = get_header_textcolor(); 340 $image = get_header_image(); 341 $style = 'display: none;'; 342 if ( $color && $color != 'blank' ) { 343 $style = 'color: #' . $color . ';'; 344 } 345 ?> 346 <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> 347 <div id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></div> 348 <?php if ( $image ) : ?> 346 349 <img src="<?php echo esc_url( $image ); ?>" alt="" /> 347 350 <?php endif; ?> 348 </div>349 <?php }351 </div> 352 <?php } 350 353 endif; // twentyeleven_admin_header_image 351 354 352 355 /** … … 367 370 add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' ); 368 371 369 372 if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) : 370 /**373 /** 371 374 * Return a "Continue Reading" link for excerpts 372 375 * 373 376 * @since Twenty Eleven 1.0 374 377 * 375 378 * @return string The "Continue Reading" HTML link. 376 379 */ 377 function twentyeleven_continue_reading_link() {378 return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>';379 }380 function twentyeleven_continue_reading_link() { 381 return ' <a href="' . esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>'; 382 } 380 383 endif; // twentyeleven_continue_reading_link 381 384 382 385 /** … … 428 431 * @return array The filtered page menu arguments. 429 432 */ 430 433 function twentyeleven_page_menu_args( $args ) { 431 if ( ! isset( $args['show_home'] ) ) 434 if ( ! isset( $args['show_home'] ) ) { 432 435 $args['show_home'] = true; 436 } 433 437 return $args; 434 438 } 435 439 add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); … … 497 501 add_action( 'widgets_init', 'twentyeleven_widgets_init' ); 498 502 499 503 if ( ! function_exists( 'twentyeleven_content_nav' ) ) : 500 /**504 /** 501 505 * Display navigation to next/previous pages when applicable. 502 506 * 503 507 * @since Twenty Eleven 1.0 504 508 * 505 509 * @param string $html_id The HTML id attribute. 506 510 */ 507 function twentyeleven_content_nav( $html_id ) {508 global $wp_query;511 function twentyeleven_content_nav( $html_id ) { 512 global $wp_query; 509 513 510 if ( $wp_query->max_num_pages > 1 ) : ?>511 <nav id="<?php echo esc_attr( $html_id ); ?>">512 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>513 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div>514 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div>515 </nav><!-- #nav-above -->516 <?php endif;517 }514 if ( $wp_query->max_num_pages > 1 ) : ?> 515 <nav id="<?php echo esc_attr( $html_id ); ?>"> 516 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> 517 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div> 518 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div> 519 </nav><!-- #nav-above --> 520 <?php endif; 521 } 518 522 endif; // twentyeleven_content_nav 519 523 520 524 /** … … 531 535 $content = get_the_content(); 532 536 $has_url = function_exists( 'get_url_in_content' ) ? get_url_in_content( $content ) : false; 533 537 534 if ( ! $has_url ) 538 if ( ! $has_url ) { 535 539 $has_url = twentyeleven_url_grabber(); 540 } 536 541 537 542 /** This filter is documented in wp-includes/link-template.php */ 538 543 return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); … … 546 551 * @return string|bool URL or false when no link is present. 547 552 */ 548 553 function twentyeleven_url_grabber() { 549 if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) 554 if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) { 550 555 return false; 556 } 551 557 552 558 return esc_url_raw( $matches[1] ); 553 559 } … … 560 566 function twentyeleven_footer_sidebar_class() { 561 567 $count = 0; 562 568 563 if ( is_active_sidebar( 'sidebar-3' ) ) 569 if ( is_active_sidebar( 'sidebar-3' ) ) { 564 570 $count++; 571 } 565 572 566 if ( is_active_sidebar( 'sidebar-4' ) ) 573 if ( is_active_sidebar( 'sidebar-4' ) ) { 567 574 $count++; 575 } 568 576 569 if ( is_active_sidebar( 'sidebar-5' ) ) 577 if ( is_active_sidebar( 'sidebar-5' ) ) { 570 578 $count++; 579 } 571 580 572 581 $class = ''; 573 582 … … 583 592 break; 584 593 } 585 594 586 if ( $class ) 595 if ( $class ) { 587 596 echo 'class="' . esc_attr( $class ) . '"'; 597 } 588 598 } 589 599 590 600 if ( ! function_exists( 'twentyeleven_comment' ) ) : 591 /**601 /** 592 602 * Template for comments and pingbacks. 593 603 * 594 604 * To override this walker in a child theme without modifying the comments template … … 602 612 * @param array $args An array of comment arguments. @see get_comment_reply_link() 603 613 * @param int $depth The depth of the comment. 604 614 */ 605 function twentyeleven_comment( $comment, $args, $depth ) {606 $GLOBALS['comment'] = $comment;607 switch ( $comment->comment_type ) :608 case 'pingback' :609 case 'trackback' :610 ?>611 <li class="post pingback">615 function twentyeleven_comment( $comment, $args, $depth ) { 616 $GLOBALS['comment'] = $comment; 617 switch ( $comment->comment_type ) : 618 case 'pingback' : 619 case 'trackback' : 620 ?> 621 <li class="post pingback"> 612 622 <p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p> 613 623 <?php 614 624 break; 615 default :616 ?>617 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">625 default : 626 ?> 627 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> 618 628 <article id="comment-<?php comment_ID(); ?>" class="comment"> 619 629 <footer class="comment-meta"> 620 630 <div class="comment-author vcard"> 621 631 <?php 622 632 $avatar_size = 68; 623 if ( '0' != $comment->comment_parent ) 624 $avatar_size = 39; 633 if ( '0' != $comment->comment_parent ) { 634 $avatar_size = 39; 635 } 625 636 626 637 echo get_avatar( $comment, $avatar_size ); 627 638 … … 635 646 sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() ) 636 647 ) 637 648 ); 638 ?>649 ?> 639 650 640 <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>641 </div><!-- .comment-author .vcard -->651 <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> 652 </div><!-- .comment-author .vcard --> 642 653 643 <?php if ( $comment->comment_approved == '0' ) : ?>654 <?php if ( $comment->comment_approved == '0' ) : ?> 644 655 <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em> 645 656 <br /> 646 657 <?php endif; ?> 647 658 648 </footer>659 </footer> 649 660 650 <div class="comment-content"><?php comment_text(); ?></div>661 <div class="comment-content"><?php comment_text(); ?></div> 651 662 652 <div class="reply"> 653 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>↓</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 654 </div><!-- .reply --> 655 </article><!-- #comment-## --> 663 <div class="reply"> 664 <?php comment_reply_link( array_merge( $args, array( 665 'reply_text' => __( 'Reply <span>↓</span>', 'twentyeleven' ), 666 'depth' => $depth, 667 'max_depth' => $args['max_depth'], 668 ) ) ); ?> 669 </div><!-- .reply --> 670 </article><!-- #comment-## --> 656 671 657 <?php672 <?php 658 673 break; 659 endswitch;660 }674 endswitch; 675 } 661 676 endif; // ends check for twentyeleven_comment() 662 677 663 678 if ( ! function_exists( 'twentyeleven_posted_on' ) ) : 664 /**679 /** 665 680 * Print HTML with meta information for the current post-date/time and author. 666 681 * 667 682 * Create your own twentyeleven_posted_on to override in a child theme 668 683 * 669 684 * @since Twenty Eleven 1.0 670 685 */ 671 function twentyeleven_posted_on() {672 printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),673 esc_url( get_permalink() ),674 esc_attr( get_the_time() ),675 esc_attr( get_the_date( 'c' ) ),676 esc_html( get_the_date() ),677 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),678 esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),679 get_the_author()680 );681 }686 function twentyeleven_posted_on() { 687 printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), 688 esc_url( get_permalink() ), 689 esc_attr( get_the_time() ), 690 esc_attr( get_the_date( 'c' ) ), 691 esc_html( get_the_date() ), 692 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 693 esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), 694 get_the_author() 695 ); 696 } 682 697 endif; 683 698 684 699 /** … … 694 709 */ 695 710 function twentyeleven_body_classes( $classes ) { 696 711 697 if ( function_exists( 'is_multi_author' ) && ! is_multi_author() ) 712 if ( function_exists( 'is_multi_author' ) && ! is_multi_author() ) { 698 713 $classes[] = 'single-author'; 714 } 699 715 700 if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) ) 716 if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) ) { 701 717 $classes[] = 'singular'; 718 } 702 719 703 720 return $classes; 704 721 } … … 719 736 720 737 if ( function_exists( 'get_post_galleries' ) ) { 721 738 $galleries = get_post_galleries( get_the_ID(), false ); 722 if ( isset( $galleries[0]['ids'] ) ) 739 if ( isset( $galleries[0]['ids'] ) ) { 723 740 $images = explode( ',', $galleries[0]['ids'] ); 741 } 724 742 } else { 725 743 $pattern = get_shortcode_regex(); 726 744 preg_match( "/$pattern/s", get_the_content(), $match ); 727 745 $atts = shortcode_parse_atts( $match[3] ); 728 if ( isset( $atts['ids'] ) ) 746 if ( isset( $atts['ids'] ) ) { 729 747 $images = explode( ',', $atts['ids'] ); 748 } 730 749 } 731 750 732 751 if ( ! $images ) { -
src/wp-content/themes/twentyeleven/header.php
35 35 36 36 // Add the blog description for the home/front page. 37 37 $site_description = get_bloginfo( 'description', 'display' ); 38 if ( $site_description && ( is_home() || is_front_page() ) ) 39 echo " | $site_description"; 38 if ( $site_description && ( is_home() || is_front_page() ) ) { 39 echo " | $site_description"; 40 } 40 41 41 42 // Add a page number if necessary: 42 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) 43 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) ); 43 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { 44 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) ); 45 } 44 46 45 47 ?></title> 46 48 <link rel="profile" href="http://gmpg.org/xfn/11" /> … … 54 56 * We add some JavaScript to pages with the comment form 55 57 * to support sites with threaded comments (when in use). 56 58 */ 57 if ( is_singular() && get_option( 'thread_comments' ) ) 58 wp_enqueue_script( 'comment-reply' ); 59 if ( is_singular() && get_option( 'thread_comments' ) ) { 60 wp_enqueue_script( 'comment-reply' ); 61 } 59 62 60 63 /* 61 64 * Always have wp_head() just before the closing </head> … … 78 81 <?php 79 82 // Check to see if the header image has been removed 80 83 $header_image = get_header_image(); 81 if ( $header_image ) : 84 if ( $header_image ) : 85 // Compatibility with versions of WordPress prior to 3.4. 86 if ( function_exists( 'get_custom_header' ) ) { 87 /* 88 * We need to figure out what the minimum width should be for our featured image. 89 * This result would be the suggested width if the theme were to implement flexible widths. 90 */ 91 $header_image_width = get_theme_support( 'custom-header', 'width' ); 92 } else { 93 $header_image_width = HEADER_IMAGE_WIDTH; 94 } 95 ?> 96 <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> 97 <?php 98 /* 99 * The header image. 100 * Check if this is a post or page, if it has a thumbnail, and if it's a big one 101 */ 102 if ( is_singular() && has_post_thumbnail( $post->ID ) && 103 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && 104 $image[1] >= $header_image_width ) : 105 // Houston, we have a new header image! 106 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 107 else : 82 108 // Compatibility with versions of WordPress prior to 3.4. 83 109 if ( function_exists( 'get_custom_header' ) ) { 84 /* 85 * We need to figure out what the minimum width should be for our featured image. 86 * This result would be the suggested width if the theme were to implement flexible widths. 87 */ 88 $header_image_width = get_theme_support( 'custom-header', 'width' ); 110 $header_image_width = get_custom_header()->width; 111 $header_image_height = get_custom_header()->height; 89 112 } else { 90 $header_image_width = HEADER_IMAGE_WIDTH; 113 $header_image_width = HEADER_IMAGE_WIDTH; 114 $header_image_height = HEADER_IMAGE_HEIGHT; 91 115 } 92 116 ?> 93 <a href="<?php echo esc_url( home_url( '/' ) ); ?>">94 <?php95 /*96 * The header image.97 * Check if this is a post or page, if it has a thumbnail, and if it's a big one98 */99 if ( is_singular() && has_post_thumbnail( $post->ID ) &&100 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&101 $image[1] >= $header_image_width ) :102 // Houston, we have a new header image!103 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );104 else :105 // Compatibility with versions of WordPress prior to 3.4.106 if ( function_exists( 'get_custom_header' ) ) {107 $header_image_width = get_custom_header()->width;108 $header_image_height = get_custom_header()->height;109 } else {110 $header_image_width = HEADER_IMAGE_WIDTH;111 $header_image_height = HEADER_IMAGE_HEIGHT;112 }113 ?>114 117 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /> 115 118 <?php endif; // end check for featured image or standard header ?> 116 119 </a> … … 118 121 119 122 <?php 120 123 // Has the text been hidden? 121 124 if ( 'blank' == get_header_textcolor() ) : 122 125 ?> 123 124 125 126 <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>"> 127 <?php get_search_form(); ?> 128 </div> 126 129 <?php 127 130 else : 128 131 ?> -
src/wp-content/themes/twentyeleven/image.php
52 52 * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, 53 53 * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file 54 54 */ 55 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); 56 foreach ( $attachments as $k => $attachment ) { 57 if ( $attachment->ID == $post->ID ) 58 break; 55 $attachments = array_values( get_children( array( 56 'post_parent' => $post->post_parent, 57 'post_status' => 'inherit', 58 'post_type' => 'attachment', 59 'post_mime_type' => 'image', 60 'order' => 'ASC', 61 'orderby' => 'menu_order ID', 62 ) ) ); 63 foreach ( $attachments as $k => $attachment ) { 64 if ( $attachment->ID == $post->ID ) { 65 break; 59 66 } 67 } 60 68 61 69 // If there is more than 1 attachment in a gallery 62 if ( count( $attachments ) > 1 ) { 63 $k++; 64 if ( isset( $attachments[ $k ] ) ) 65 // get the URL of the next image attachment 66 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 67 else 68 // or get the URL of the first image attachment 69 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 70 } else { 71 // or, if there's only 1 image, get the URL of the image 72 $next_attachment_url = wp_get_attachment_url(); 70 if ( count( $attachments ) > 1 ) { 71 $k++; 72 if ( isset( $attachments[ $k ] ) ) { 73 // get the URL of the next image attachment 74 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 75 } else { // End if(). 76 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 73 77 } 78 } else { 79 // or, if there's only 1 image, get the URL of the image 80 $next_attachment_url = wp_get_attachment_url(); 81 } 74 82 ?> 75 83 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php 76 84 /** … … 95 103 96 104 <div class="entry-description"> 97 105 <?php the_content(); ?> 98 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> 106 <?php wp_link_pages( array( 107 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 108 'after' => '</div>', 109 ) ); ?> 99 110 </div><!-- .entry-description --> 100 111 101 112 </div><!-- .entry-content --> … … 109 120 </div><!-- #content --> 110 121 </div><!-- #primary --> 111 122 112 <?php get_footer(); ?> 113 No newline at end of file 123 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/inc/theme-options.php
99 99 'twentyeleven_theme_options_render_page' // Function that renders the options page 100 100 ); 101 101 102 if ( ! $theme_page ) 102 if ( ! $theme_page ) { 103 103 return; 104 } 104 105 105 106 add_action( "load-$theme_page", 'twentyeleven_theme_options_help' ); 106 107 } … … 217 218 'theme_layout' => 'content-sidebar', 218 219 ); 219 220 220 if ( is_rtl() ) 221 if ( is_rtl() ) { 221 222 $default_theme_options['theme_layout'] = 'sidebar-content'; 223 } 222 224 223 225 /** 224 226 * Filter the Twenty Eleven default options. … … 246 248 } 247 249 248 250 $color_schemes = twentyeleven_color_schemes(); 249 if ( ! isset( $color_schemes[ $color_scheme ] ) ) 251 if ( ! isset( $color_schemes[ $color_scheme ] ) ) { 250 252 return false; 253 } 251 254 252 255 return $color_schemes[ $color_scheme ]['default_link_color']; 253 256 } … … 364 367 $output = $defaults = twentyeleven_get_default_theme_options(); 365 368 366 369 // Color scheme must be in our array of color scheme options 367 if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) 370 if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) ) { 368 371 $output['color_scheme'] = $input['color_scheme']; 372 } 369 373 370 374 // Our defaults for the link color may have changed, based on the color scheme. 371 375 $output['link_color'] = $defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] ); 372 376 373 377 // Link color must be 3 or 6 hexadecimal characters 374 if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) ) 378 if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) ) { 375 379 $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) ); 380 } 376 381 377 382 // Theme layout must be in our array of theme layout options 378 if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) 383 if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) { 379 384 $output['theme_layout'] = $input['theme_layout']; 385 } 380 386 381 387 /** 382 388 * Filter the Twenty Eleven sanitized form input array. … … 399 405 $options = twentyeleven_get_theme_options(); 400 406 $color_scheme = $options['color_scheme']; 401 407 402 if ( 'dark' == $color_scheme ) 408 if ( 'dark' == $color_scheme ) { 403 409 wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); 410 } 404 411 405 412 /** 406 413 * Fires after the styles for the Twenty Eleven color scheme are enqueued. … … 427 434 $default_options = twentyeleven_get_default_theme_options(); 428 435 429 436 // Don't do anything if the current link color is the default. 430 if ( $default_options['link_color'] == $link_color ) 437 if ( $default_options['link_color'] == $link_color ) { 431 438 return; 439 } 432 440 ?> 433 441 <style> 434 442 /* Link color */ … … 472 480 $options = twentyeleven_get_theme_options(); 473 481 $current_layout = $options['theme_layout']; 474 482 475 if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) ) 483 if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) ) { 476 484 $classes = array( 'two-column' ); 477 else478 $classes = array( 'one-column' );485 } else { $classes = array( 'one-column' ); 486 } 479 487 480 if ( 'content-sidebar' == $current_layout ) 488 if ( 'content-sidebar' == $current_layout ) { 481 489 $classes[] = 'right-sidebar'; 482 elseif ( 'sidebar-content' == $current_layout )490 } elseif ( 'sidebar-content' == $current_layout ) { 483 491 $classes[] = 'left-sidebar'; 484 else485 $classes[] = $current_layout;492 } else { $classes[] = $current_layout; 493 } 486 494 487 495 /** 488 496 * Filter the Twenty Eleven layout body classes. -
src/wp-content/themes/twentyeleven/inc/widgets.php
50 50 function widget( $args, $instance ) { 51 51 $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); 52 52 53 if ( ! is_array( $cache ) ) 53 if ( ! is_array( $cache ) ) { 54 54 $cache = array(); 55 } 55 56 56 if ( ! isset( $args['widget_id'] ) ) 57 if ( ! isset( $args['widget_id'] ) ) { 57 58 $args['widget_id'] = null; 59 } 58 60 59 61 if ( ! is_customize_preview() && isset( $cache[ $args['widget_id'] ] ) ) { 60 62 echo $cache[ $args['widget_id'] ]; … … 67 69 /** This filter is documented in wp-includes/default-widgets.php */ 68 70 $args['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base ); 69 71 70 if ( ! isset( $instance['number'] ) ) 72 if ( ! isset( $instance['number'] ) ) { 71 73 $instance['number'] = '10'; 74 } 72 75 73 if ( ! $args['number'] = absint( $instance['number'] ) ) 76 if ( ! $args['number'] = absint( $instance['number'] ) ) { 74 77 $args['number'] = 10; 78 } 75 79 76 80 $ephemera_args = array( 77 81 'order' => 'DESC', … … 128 132 // Reset the post globals as this query will have stomped on it 129 133 wp_reset_postdata(); 130 134 131 // end check for ephemeral posts135 // end check for ephemeral posts 132 136 endif; 133 137 134 138 $cache[ $args['widget_id'] ] = ob_get_flush(); … … 153 157 $this->flush_widget_cache(); 154 158 155 159 $alloptions = wp_cache_get( 'alloptions', 'options' ); 156 if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) ) 160 if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) ) { 157 161 delete_option( 'widget_twentyeleven_ephemera' ); 162 } 158 163 159 164 return $instance; 160 165 } … … 176 181 * @since Twenty Eleven 1.0 177 182 **/ 178 183 function form( $instance ) { 179 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';184 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 180 185 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10; 181 186 ?> 182 187 <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyeleven' ); ?></label> -
src/wp-content/themes/twentyeleven/page.php
28 28 </div><!-- #content --> 29 29 </div><!-- #primary --> 30 30 31 <?php get_footer(); ?> 32 No newline at end of file 31 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/search.php
56 56 </section><!-- #primary --> 57 57 58 58 <?php get_sidebar(); ?> 59 <?php get_footer(); ?> 60 No newline at end of file 59 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/showcase.php
30 30 * We are using a heading by rendering the_content 31 31 * If we have content for this page, let's display it. 32 32 */ 33 if ( '' != get_the_content() ) 34 get_template_part( 'content', 'intro' ); 33 if ( '' != get_the_content() ) { 34 get_template_part( 'content', 'intro' ); 35 } 35 36 ?> 36 37 37 38 <?php endwhile; ?> … … 46 47 $sticky = get_option( 'sticky_posts' ); 47 48 48 49 // Proceed only if sticky posts exist. 49 50 if ( ! empty( $sticky ) ) : 50 51 51 52 $featured_args = array( 52 53 54 55 53 'post__in' => $sticky, 54 'post_status' => 'publish', 55 'posts_per_page' => 10, 56 'no_found_rows' => true, 56 57 ); 57 58 58 59 // The Featured Posts query. … … 61 62 // Proceed only if published posts exist 62 63 if ( $featured->have_posts() ) : 63 64 64 /*65 66 67 68 $counter_slider = 0;65 /* 66 * We will need to count featured posts starting from zero 67 * to create the slider navigation. 68 */ 69 $counter_slider = 0; 69 70 70 // Compatibility with versions of WordPress prior to 3.4.71 if ( function_exists( 'get_custom_header' ) )72 $header_image_width = get_theme_support( 'custom-header', 'width' );73 else74 $header_image_width = HEADER_IMAGE_WIDTH;75 ?>71 // Compatibility with versions of WordPress prior to 3.4. 72 if ( function_exists( 'get_custom_header' ) ) { 73 $header_image_width = get_theme_support( 'custom-header', 'width' ); 74 } else { $header_image_width = HEADER_IMAGE_WIDTH; 75 } 76 ?> 76 77 77 <div class="featured-posts">78 <div class="featured-posts"> 78 79 <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1> 79 80 80 81 <?php 81 82 82 // Let's roll. 83 while ( $featured->have_posts() ) : $featured->the_post(); 83 84 84 85 // Increase the counter. 85 86 $counter_slider++; 86 87 87 88 /* 88 89 90 89 * We're going to add a class to our featured post for featured images 90 * by default it'll have the feature-text class. 91 */ 91 92 $feature_class = 'feature-text'; 92 93 93 94 if ( has_post_thumbnail() ) { … … 107 108 108 109 <section class="featured-post <?php echo esc_attr( $feature_class ); ?>" id="featured-post-<?php echo esc_attr( $counter_slider ); ?>"> 109 110 110 <?php 111 /* 112 * If the thumbnail is as big as the header image 113 * make it a large featured post, otherwise render it small 114 */ 115 if ( has_post_thumbnail() ) { 116 if ( $image[1] >= $header_image_width ) 117 $thumbnail_size = 'large-feature'; 118 else 119 $thumbnail_size = 'small-feature'; 120 ?> 121 <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a> 122 <?php 123 } 111 <?php 112 /* 113 * If the thumbnail is as big as the header image 114 * make it a large featured post, otherwise render it small 115 */ 116 if ( has_post_thumbnail() ) { 117 if ( $image[1] >= $header_image_width ) { 118 $thumbnail_size = 'large-feature'; 119 } else { $thumbnail_size = 'small-feature'; 120 } 124 121 ?> 125 <?php get_template_part( 'content', 'featured' ); ?> 122 <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a> 123 <?php 124 } 125 ?> 126 <?php get_template_part( 'content', 'featured' ); ?> 126 127 </section> 127 128 <?php endwhile; ?> 128 129 129 <?php130 <?php 130 131 // Show slider only if we have more than one featured post. 131 132 if ( $featured->post_count > 1 ) : 132 ?>133 <nav class="feature-slider">133 ?> 134 <nav class="feature-slider"> 134 135 <ul> 135 136 <?php 136 137 137 138 138 // Reset the counter so that we end up with matching elements 139 $counter_slider = 0; 139 140 140 141 141 // Begin from zero 142 rewind_posts(); 142 143 143 144 145 146 if ( 1 == $counter_slider )147 148 else149 $class = '';150 151 152 144 // Let's roll again. 145 while ( $featured->have_posts() ) : $featured->the_post(); 146 $counter_slider++; 147 if ( 1 == $counter_slider ) { 148 $class = ' class="active"'; 149 } else { $class = ''; 150 } 151 ?> 152 <li><a href="#featured-post-<?php echo esc_attr( $counter_slider ); ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>"<?php echo $class; ?>></a></li> 153 <?php endwhile; ?> 153 154 </ul> 154 155 </nav> 155 156 <?php endif; // End check for more than one sticky post. ?> … … 207 208 endwhile; 208 209 209 210 // If we had some posts, close the <ol> 210 if ( $recent->post_count > 0 ) 211 if ( $recent->post_count > 0 ) { 211 212 echo '</ol>'; 213 } 212 214 ?> 213 215 </section><!-- .recent-posts --> 214 216 … … 216 218 <?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?> 217 219 218 220 <?php 219 the_widget( 'Twenty_Eleven_Ephemera_Widget', '', array( 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) ); 221 the_widget( 'Twenty_Eleven_Ephemera_Widget', '', array( 222 'before_title' => '<h3 class="widget-title">', 223 'after_title' => '</h3>', 224 ) ); 220 225 ?> 221 226 222 227 <?php endif; // end sidebar widget area ?> … … 225 230 </div><!-- #content --> 226 231 </div><!-- #primary --> 227 232 228 <?php get_footer(); ?> 229 No newline at end of file 233 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/sidebar-footer.php
15 15 * 16 16 * If none of the sidebars have widgets, then let's bail early. 17 17 */ 18 if ( ! is_active_sidebar( 'sidebar-3')18 if ( ! is_active_sidebar( 'sidebar-3' ) 19 19 && ! is_active_sidebar( 'sidebar-4' ) 20 && ! is_active_sidebar( 'sidebar-5' ) 21 ) 22 return; 20 && ! is_active_sidebar( 'sidebar-5' ) 21 ) { 22 return; 23 } 23 24 // If we get this far, we have widgets. Let do this. 24 25 ?> 25 26 <div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>> … … 40 41 <?php dynamic_sidebar( 'sidebar-5' ); ?> 41 42 </div><!-- #third .widget-area --> 42 43 <?php endif; ?> 43 </div><!-- #supplementary --> 44 No newline at end of file 44 </div><!-- #supplementary --> -
src/wp-content/themes/twentyeleven/sidebar-page.php
26 26 </div><!-- #primary --> 27 27 28 28 <?php get_sidebar(); ?> 29 <?php get_footer(); ?> 30 No newline at end of file 29 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/sidebar.php
33 33 34 34 <?php endif; // end sidebar widget area ?> 35 35 </div><!-- #secondary .widget-area --> 36 <?php endif; ?> 37 No newline at end of file 36 <?php endif; ?> -
src/wp-content/themes/twentyeleven/single.php
29 29 </div><!-- #content --> 30 30 </div><!-- #primary --> 31 31 32 <?php get_footer(); ?> 33 No newline at end of file 32 <?php get_footer(); ?> -
src/wp-content/themes/twentyeleven/tag.php
21 21 22 22 <?php 23 23 $tag_description = tag_description(); 24 25 24 if ( ! empty( $tag_description ) ) { 25 /** 26 26 * Filter the default Twenty Eleven tag description. 27 27 * 28 28 * @since Twenty Eleven 1.0 29 29 * 30 30 * @param string The default tag description. 31 31 */ 32 33 32 echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' ); 33 } 34 34 ?> 35 35 </header> 36 36 -
src/wp-content/themes/twentyfifteen/archive.php
41 41 */ 42 42 get_template_part( 'content', get_post_format() ); 43 43 44 // End the loop.44 // End the loop. 45 45 endwhile; 46 46 47 47 // Previous/next page navigation. … … 51 51 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', 52 52 ) ); 53 53 54 // If no content, include the "No posts found" template.54 // If no content, include the "No posts found" template. 55 55 else : 56 56 get_template_part( 'content', 'none' ); 57 57 -
src/wp-content/themes/twentyfifteen/comments.php
26 26 <h2 class="comments-title"> 27 27 <?php 28 28 printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentyfifteen' ), 29 29 number_format_i18n( get_comments_number() ), get_the_title() ); 30 30 ?> 31 31 </h2> 32 32 … … 48 48 49 49 <?php 50 50 // If comments are closed and there are comments, let's leave a little note, shall we? 51 51 if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : 52 52 ?> 53 53 <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> 54 54 <?php endif; ?> 55 55 56 56 <?php comment_form(); ?> -
src/wp-content/themes/twentyfifteen/content-link.php
15 15 16 16 <header class="entry-header"> 17 17 <?php 18 19 18 if ( is_single() ) : 19 the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' ); 20 20 else : 21 21 the_title( sprintf( '<h2 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h2>' ); 22 22 endif; … … 46 46 47 47 <?php 48 48 // Author bio. 49 50 49 if ( is_single() && get_the_author_meta( 'description' ) ) : 50 get_template_part( 'author-bio' ); 51 51 endif; 52 52 ?> 53 53 -
src/wp-content/themes/twentyfifteen/content.php
18 18 19 19 <header class="entry-header"> 20 20 <?php 21 22 21 if ( is_single() ) : 22 the_title( '<h1 class="entry-title">', '</h1>' ); 23 23 else : 24 24 the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); 25 25 endif; … … 47 47 48 48 <?php 49 49 // Author bio. 50 51 50 if ( is_single() && get_the_author_meta( 'description' ) ) : 51 get_template_part( 'author-bio' ); 52 52 endif; 53 53 ?> 54 54 -
src/wp-content/themes/twentyfifteen/functions.php
42 42 } 43 43 44 44 if ( ! function_exists( 'twentyfifteen_setup' ) ) : 45 /**45 /** 46 46 * Sets up theme defaults and registers support for various WordPress features. 47 47 * 48 48 * Note that this function is hooked into the after_setup_theme hook, which … … 51 51 * 52 52 * @since Twenty Fifteen 1.0 53 53 */ 54 function twentyfifteen_setup() { 55 56 /* 57 * Make theme available for translation. 58 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen 59 * If you're building a theme based on twentyfifteen, use a find and replace 60 * to change 'twentyfifteen' to the name of your theme in all the template files 61 */ 62 load_theme_textdomain( 'twentyfifteen' ); 63 64 // Add default posts and comments RSS feed links to head. 65 add_theme_support( 'automatic-feed-links' ); 66 67 /* 68 * Let WordPress manage the document title. 69 * By adding theme support, we declare that this theme does not use a 70 * hard-coded <title> tag in the document head, and expect WordPress to 71 * provide it for us. 72 */ 73 add_theme_support( 'title-tag' ); 74 75 /* 76 * Enable support for Post Thumbnails on posts and pages. 77 * 78 * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 79 */ 80 add_theme_support( 'post-thumbnails' ); 81 set_post_thumbnail_size( 825, 510, true ); 82 83 // This theme uses wp_nav_menu() in two locations. 84 register_nav_menus( array( 85 'primary' => __( 'Primary Menu', 'twentyfifteen' ), 86 'social' => __( 'Social Links Menu', 'twentyfifteen' ), 87 ) ); 88 89 /* 90 * Switch default core markup for search form, comment form, and comments 91 * to output valid HTML5. 92 */ 93 add_theme_support( 'html5', array( 94 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' 95 ) ); 54 function twentyfifteen_setup() { 96 55 97 /* 98 * Enable support for Post Formats. 99 * 100 * See: https://codex.wordpress.org/Post_Formats 101 */ 102 add_theme_support( 'post-formats', array( 103 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat' 104 ) ); 105 106 /* 107 * Enable support for custom logo. 108 * 109 * @since Twenty Fifteen 1.5 110 */ 111 add_theme_support( 'custom-logo', array( 112 'height' => 248, 113 'width' => 248, 114 'flex-height' => true, 115 ) ); 56 /* 57 * Make theme available for translation. 58 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen 59 * If you're building a theme based on twentyfifteen, use a find and replace 60 * to change 'twentyfifteen' to the name of your theme in all the template files 61 */ 62 load_theme_textdomain( 'twentyfifteen' ); 63 64 // Add default posts and comments RSS feed links to head. 65 add_theme_support( 'automatic-feed-links' ); 66 67 /* 68 * Let WordPress manage the document title. 69 * By adding theme support, we declare that this theme does not use a 70 * hard-coded <title> tag in the document head, and expect WordPress to 71 * provide it for us. 72 */ 73 add_theme_support( 'title-tag' ); 74 75 /* 76 * Enable support for Post Thumbnails on posts and pages. 77 * 78 * See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 79 */ 80 add_theme_support( 'post-thumbnails' ); 81 set_post_thumbnail_size( 825, 510, true ); 82 83 // This theme uses wp_nav_menu() in two locations. 84 register_nav_menus( array( 85 'primary' => __( 'Primary Menu', 'twentyfifteen' ), 86 'social' => __( 'Social Links Menu', 'twentyfifteen' ), 87 ) ); 88 89 /* 90 * Switch default core markup for search form, comment form, and comments 91 * to output valid HTML5. 92 */ 93 add_theme_support( 'html5', array( 94 'search-form', 95 'comment-form', 96 'comment-list', 97 'gallery', 98 'caption', 99 ) ); 100 101 /* 102 * Enable support for Post Formats. 103 * 104 * See: https://codex.wordpress.org/Post_Formats 105 */ 106 add_theme_support( 'post-formats', array( 107 'aside', 108 'image', 109 'video', 110 'quote', 111 'link', 112 'gallery', 113 'status', 114 'audio', 115 'chat', 116 ) ); 117 118 /* 119 * Enable support for custom logo. 120 * 121 * @since Twenty Fifteen 1.5 122 */ 123 add_theme_support( 'custom-logo', array( 124 'height' => 248, 125 'width' => 248, 126 'flex-height' => true, 127 ) ); 116 128 117 $color_scheme = twentyfifteen_get_color_scheme();118 $default_color = trim( $color_scheme[0], '#' );129 $color_scheme = twentyfifteen_get_color_scheme(); 130 $default_color = trim( $color_scheme[0], '#' ); 119 131 120 // Setup the WordPress core custom background feature.132 // Setup the WordPress core custom background feature. 121 133 122 /**134 /** 123 135 * Filter Twenty Fifteen custom-header support arguments. 124 136 * 125 137 * @since Twenty Fifteen 1.0 … … 131 143 * @type string $default-attachment Default attachment of the header. 132 144 * } 133 145 */ 134 add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array(135 'default-color' => $default_color,136 'default-attachment' => 'fixed',137 ) ) );138 139 /*140 * This theme styles the visual editor to resemble the theme style,141 * specifically font, colors, icons, and column width.142 */143 add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) );146 add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array( 147 'default-color' => $default_color, 148 'default-attachment' => 'fixed', 149 ) ) ); 150 151 /* 152 * This theme styles the visual editor to resemble the theme style, 153 * specifically font, colors, icons, and column width. 154 */ 155 add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) ); 144 156 145 // Indicate widget sidebars can use selective refresh in the Customizer.146 add_theme_support( 'customize-selective-refresh-widgets' );147 }157 // Indicate widget sidebars can use selective refresh in the Customizer. 158 add_theme_support( 'customize-selective-refresh-widgets' ); 159 } 148 160 endif; // twentyfifteen_setup 149 161 add_action( 'after_setup_theme', 'twentyfifteen_setup' ); 150 162 … … 169 181 add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); 170 182 171 183 if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) : 172 /**184 /** 173 185 * Register Google fonts for Twenty Fifteen. 174 186 * 175 187 * @since Twenty Fifteen 1.0 176 188 * 177 189 * @return string Google fonts URL for the theme. 178 190 */ 179 function twentyfifteen_fonts_url() {180 $fonts_url = '';181 $fonts = array();182 $subsets = 'latin,latin-ext';183 184 /*185 * Translators: If there are characters in your language that are not supported186 * by Noto Sans, translate this to 'off'. Do not translate into your own language.187 */188 if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) {189 $fonts[] = 'Noto Sans:400italic,700italic,400,700';190 }191 function twentyfifteen_fonts_url() { 192 $fonts_url = ''; 193 $fonts = array(); 194 $subsets = 'latin,latin-ext'; 195 196 /* 197 * Translators: If there are characters in your language that are not supported 198 * by Noto Sans, translate this to 'off'. Do not translate into your own language. 199 */ 200 if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) { 201 $fonts[] = 'Noto Sans:400italic,700italic,400,700'; 202 } 191 203 192 /*193 * Translators: If there are characters in your language that are not supported194 * by Noto Serif, translate this to 'off'. Do not translate into your own language.195 */196 if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) {197 $fonts[] = 'Noto Serif:400italic,700italic,400,700';198 }204 /* 205 * Translators: If there are characters in your language that are not supported 206 * by Noto Serif, translate this to 'off'. Do not translate into your own language. 207 */ 208 if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) { 209 $fonts[] = 'Noto Serif:400italic,700italic,400,700'; 210 } 199 211 200 /*201 * Translators: If there are characters in your language that are not supported202 * by Inconsolata, translate this to 'off'. Do not translate into your own language.203 */204 if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) {205 $fonts[] = 'Inconsolata:400,700';206 }212 /* 213 * Translators: If there are characters in your language that are not supported 214 * by Inconsolata, translate this to 'off'. Do not translate into your own language. 215 */ 216 if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) { 217 $fonts[] = 'Inconsolata:400,700'; 218 } 207 219 208 /* 209 * Translators: To add an additional character subset specific to your language, 210 * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. 211 */ 212 $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' ); 220 /* 221 * Translators: To add an additional character subset specific to your language, 222 * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. 223 */ 224 $subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' ); 225 226 if ( 'cyrillic' == $subset ) { 227 $subsets .= ',cyrillic,cyrillic-ext'; 228 } elseif ( 'greek' == $subset ) { 229 $subsets .= ',greek,greek-ext'; 230 } elseif ( 'devanagari' == $subset ) { 231 $subsets .= ',devanagari'; 232 } elseif ( 'vietnamese' == $subset ) { 233 $subsets .= ',vietnamese'; 234 } 213 235 214 if ( 'cyrillic' == $subset ) { 215 $subsets .= ',cyrillic,cyrillic-ext'; 216 } elseif ( 'greek' == $subset ) { 217 $subsets .= ',greek,greek-ext'; 218 } elseif ( 'devanagari' == $subset ) { 219 $subsets .= ',devanagari'; 220 } elseif ( 'vietnamese' == $subset ) { 221 $subsets .= ',vietnamese'; 222 } 236 if ( $fonts ) { 237 $fonts_url = add_query_arg( array( 238 'family' => urlencode( implode( '|', $fonts ) ), 239 'subset' => urlencode( $subsets ), 240 ), 'https://fonts.googleapis.com/css' ); 241 } 223 242 224 if ( $fonts ) { 225 $fonts_url = add_query_arg( array( 226 'family' => urlencode( implode( '|', $fonts ) ), 227 'subset' => urlencode( $subsets ), 228 ), 'https://fonts.googleapis.com/css' ); 243 return $fonts_url; 229 244 } 230 231 return $fonts_url;232 }233 245 endif; 234 246 235 247 /** -
src/wp-content/themes/twentyfifteen/header.php
31 31 <?php 32 32 twentyfifteen_the_custom_logo(); 33 33 34 34 if ( is_front_page() && is_home() ) : ?> 35 35 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> 36 36 <?php else : ?> 37 37 <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> 38 38 <?php endif; 39 39 40 40 $description = get_bloginfo( 'description', 'display' ); 41 41 if ( $description || is_customize_preview() ) : ?> 42 42 <p class="site-description"><?php echo $description; ?></p> 43 43 <?php endif; 44 44 ?> -
src/wp-content/themes/twentyfifteen/image.php
14 14 15 15 <?php 16 16 // Start the loop. 17 17 while ( have_posts() ) : the_post(); 18 18 ?> 19 19 20 20 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 21 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 22 <nav id="image-navigation" class="navigation image-navigation"> 23 <div class="nav-links"> 24 <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div> 25 </div><!-- .nav-links --> 26 </nav><!-- .image-navigation --> 27 28 <header class="entry-header"> 29 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> 30 </header><!-- .entry-header --> 31 32 <div class="entry-content"> 33 34 <div class="entry-attachment"> 35 <?php 36 /** 37 37 * Filter the default Twenty Fifteen image attachment size. 38 38 * 39 39 * @since Twenty Fifteen 1.0 40 40 * 41 41 * @param string $image_size Image size. Default 'large'. 42 42 */ 43 43 $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' ); 44 44 45 46 45 echo wp_get_attachment_image( get_the_ID(), $image_size ); 46 ?> 47 47 48 48 <?php if ( has_excerpt() ) : ?> 49 49 <div class="entry-caption"> 50 50 <?php the_excerpt(); ?> 51 51 </div><!-- .entry-caption --> … … 54 54 </div><!-- .entry-attachment --> 55 55 56 56 <?php 57 58 59 60 61 62 63 64 65 66 57 the_content(); 58 wp_link_pages( array( 59 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>', 60 'after' => '</div>', 61 'link_before' => '<span>', 62 'link_after' => '</span>', 63 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%', 64 'separator' => '<span class="screen-reader-text">, </span>', 65 ) ); 66 ?> 67 67 </div><!-- .entry-content --> 68 68 69 69 <footer class="entry-footer"> 70 71 70 <?php twentyfifteen_entry_meta(); ?> 71 <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?> 72 72 </footer><!-- .entry-footer --> 73 73 74 74 </article><!-- #post-## --> 75 75 76 76 <?php 77 78 79 77 // If comments are open or we have at least one comment, load up the comment template 78 if ( comments_open() || get_comments_number() ) : 79 comments_template(); 80 80 endif; 81 81 82 83 84 85 82 // Previous/next post navigation. 83 the_post_navigation( array( 84 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentyfifteen' ), 85 ) ); 86 86 87 87 // End the loop. 88 88 endwhile; -
src/wp-content/themes/twentyfifteen/inc/custom-header.php
53 53 $color = trim( $color, '#' ); 54 54 55 55 if ( strlen( $color ) == 3 ) { 56 $r = hexdec( substr( $color, 0, 1 ) .substr( $color, 0, 1 ) );57 $g = hexdec( substr( $color, 1, 1 ) .substr( $color, 1, 1 ) );58 $b = hexdec( substr( $color, 2, 1 ) .substr( $color, 2, 1 ) );59 } else 56 $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); 57 $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); 58 $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); 59 } elseif ( strlen( $color ) == 6 ) { 60 60 $r = hexdec( substr( $color, 0, 2 ) ); 61 61 $g = hexdec( substr( $color, 2, 2 ) ); 62 62 $b = hexdec( substr( $color, 4, 2 ) ); … … 64 64 return array(); 65 65 } 66 66 67 return array( 'red' => $r, 'green' => $g, 'blue' => $b ); 67 return array( 68 'red' => $r, 69 'green' => $g, 70 'blue' => $b, 71 ); 68 72 } 69 73 70 74 if ( ! function_exists( 'twentyfifteen_header_style' ) ) : 71 /**75 /** 72 76 * Styles the header image and text displayed on the blog. 73 77 * 74 78 * @since Twenty Fifteen 1.0 75 79 * 76 80 * @see twentyfifteen_custom_header_setup() 77 81 */ 78 function twentyfifteen_header_style() {79 $header_image = get_header_image();82 function twentyfifteen_header_style() { 83 $header_image = get_header_image(); 80 84 81 // If no custom options for text are set, let's bail.82 if ( empty( $header_image ) && display_header_text() ) {83 return;84 }85 // If no custom options for text are set, let's bail. 86 if ( empty( $header_image ) && display_header_text() ) { 87 return; 88 } 85 89 86 // If we get this far, we have custom styles. Let's do this.87 ?>88 <style type="text/css" id="twentyfifteen-header-css">89 <?php90 // If we get this far, we have custom styles. Let's do this. 91 ?> 92 <style type="text/css" id="twentyfifteen-header-css"> 93 <?php 90 94 // Short header for when there is no Custom Header and Header Text is hidden. 91 95 if ( empty( $header_image ) && ! display_header_text() ) : 92 96 ?> … … 182 186 <?php endif; ?> 183 187 </style> 184 188 <?php 185 }189 } 186 190 endif; // twentyfifteen_header_style 187 191 188 192 /** -
src/wp-content/themes/twentyfifteen/inc/customizer.php
216 216 } 217 217 218 218 if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) : 219 /**219 /** 220 220 * Get the current Twenty Fifteen color scheme. 221 221 * 222 222 * @since Twenty Fifteen 1.0 223 223 * 224 224 * @return array An associative array of either the current or default color scheme hex values. 225 225 */ 226 function twentyfifteen_get_color_scheme() {227 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );228 $color_schemes = twentyfifteen_get_color_schemes();226 function twentyfifteen_get_color_scheme() { 227 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); 228 $color_schemes = twentyfifteen_get_color_schemes(); 229 229 230 if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {231 return $color_schemes[ $color_scheme_option ]['colors'];232 }230 if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { 231 return $color_schemes[ $color_scheme_option ]['colors']; 232 } 233 233 234 return $color_schemes['default']['colors'];235 }234 return $color_schemes['default']['colors']; 235 } 236 236 endif; // twentyfifteen_get_color_scheme 237 237 238 238 if ( ! function_exists( 'twentyfifteen_get_color_scheme_choices' ) ) : 239 /**239 /** 240 240 * Returns an array of color scheme choices registered for Twenty Fifteen. 241 241 * 242 242 * @since Twenty Fifteen 1.0 243 243 * 244 244 * @return array Array of color schemes. 245 245 */ 246 function twentyfifteen_get_color_scheme_choices() {247 $color_schemes = twentyfifteen_get_color_schemes();248 $color_scheme_control_options = array();246 function twentyfifteen_get_color_scheme_choices() { 247 $color_schemes = twentyfifteen_get_color_schemes(); 248 $color_scheme_control_options = array(); 249 249 250 foreach ( $color_schemes as $color_scheme => $value ) {251 $color_scheme_control_options[ $color_scheme ] = $value['label'];252 }250 foreach ( $color_schemes as $color_scheme => $value ) { 251 $color_scheme_control_options[ $color_scheme ] = $value['label']; 252 } 253 253 254 return $color_scheme_control_options;255 }254 return $color_scheme_control_options; 255 } 256 256 endif; // twentyfifteen_get_color_scheme_choices 257 257 258 258 if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) : 259 /**259 /** 260 260 * Sanitization callback for color schemes. 261 261 * 262 262 * @since Twenty Fifteen 1.0 … … 264 264 * @param string $value Color scheme name value. 265 265 * @return string Color scheme name. 266 266 */ 267 function twentyfifteen_sanitize_color_scheme( $value ) {268 $color_schemes = twentyfifteen_get_color_scheme_choices();267 function twentyfifteen_sanitize_color_scheme( $value ) { 268 $color_schemes = twentyfifteen_get_color_scheme_choices(); 269 269 270 if ( ! array_key_exists( $value, $color_schemes ) ) {271 $value = 'default';272 }270 if ( ! array_key_exists( $value, $color_schemes ) ) { 271 $value = 'default'; 272 } 273 273 274 return $value;275 }274 return $value; 275 } 276 276 endif; // twentyfifteen_sanitize_color_scheme 277 277 278 278 /** -
src/wp-content/themes/twentyfifteen/inc/template-tags.php
10 10 */ 11 11 12 12 if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) : 13 /**13 /** 14 14 * Display navigation to next/previous comments when applicable. 15 15 * 16 16 * @since Twenty Fifteen 1.0 17 17 */ 18 function twentyfifteen_comment_nav() {19 // Are there comments to navigate through?20 if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :21 ?>22 <nav class="navigation comment-navigation" role="navigation">18 function twentyfifteen_comment_nav() { 19 // Are there comments to navigate through? 20 if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : 21 ?> 22 <nav class="navigation comment-navigation" role="navigation"> 23 23 <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2> 24 24 <div class="nav-links"> 25 25 <?php 26 27 26 if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) : 27 printf( '<div class="nav-previous">%s</div>', $prev_link ); 28 28 endif; 29 29 30 31 30 if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) : 31 printf( '<div class="nav-next">%s</div>', $next_link ); 32 32 endif; 33 33 ?> 34 </div><!-- .nav-links -->35 </nav><!-- .comment-navigation -->36 <?php37 endif;38 }34 </div><!-- .nav-links --> 35 </nav><!-- .comment-navigation --> 36 <?php 37 endif; 38 } 39 39 endif; 40 40 41 41 if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) : 42 /**42 /** 43 43 * Prints HTML with meta information for the categories, tags. 44 44 * 45 45 * @since Twenty Fifteen 1.0 46 46 */ 47 function twentyfifteen_entry_meta() { 48 if ( is_sticky() && is_home() && ! is_paged() ) { 49 printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) ); 50 } 51 52 $format = get_post_format(); 53 if ( current_theme_supports( 'post-formats', $format ) ) { 54 printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', 55 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ), 56 esc_url( get_post_format_link( $format ) ), 57 get_post_format_string( $format ) 58 ); 59 } 60 61 if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { 62 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; 47 function twentyfifteen_entry_meta() { 48 if ( is_sticky() && is_home() && ! is_paged() ) { 49 printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) ); 50 } 63 51 64 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 65 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 52 $format = get_post_format(); 53 if ( current_theme_supports( 'post-formats', $format ) ) { 54 printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', 55 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ), 56 esc_url( get_post_format_link( $format ) ), 57 get_post_format_string( $format ) 58 ); 66 59 } 67 60 68 $time_string = sprintf( $time_string, 69 esc_attr( get_the_date( 'c' ) ), 70 get_the_date(), 71 esc_attr( get_the_modified_date( 'c' ) ), 72 get_the_modified_date() 73 ); 61 if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { 62 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; 74 63 75 printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', 76 _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ), 77 esc_url( get_permalink() ), 78 $time_string 79 ); 80 } 64 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 65 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 66 } 67 68 $time_string = sprintf( $time_string, 69 esc_attr( get_the_date( 'c' ) ), 70 get_the_date(), 71 esc_attr( get_the_modified_date( 'c' ) ), 72 get_the_modified_date() 73 ); 81 74 82 if ( 'post' == get_post_type() ) { 83 if ( is_singular() || is_multi_author() ) { 84 printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', 85 _x( 'Author', 'Used before post author name.', 'twentyfifteen' ), 86 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 87 get_the_author() 75 printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', 76 _x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ), 77 esc_url( get_permalink() ), 78 $time_string 88 79 ); 89 80 } 90 81 91 $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); 92 if ( $categories_list && twentyfifteen_categorized_blog() ) { 93 printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 94 _x( 'Categories', 'Used before category names.', 'twentyfifteen' ), 95 $categories_list 96 ); 82 if ( 'post' == get_post_type() ) { 83 if ( is_singular() || is_multi_author() ) { 84 printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', 85 _x( 'Author', 'Used before post author name.', 'twentyfifteen' ), 86 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 87 get_the_author() 88 ); 89 } 90 91 $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); 92 if ( $categories_list && twentyfifteen_categorized_blog() ) { 93 printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 94 _x( 'Categories', 'Used before category names.', 'twentyfifteen' ), 95 $categories_list 96 ); 97 } 98 99 $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); 100 if ( $tags_list ) { 101 printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 102 _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ), 103 $tags_list 104 ); 105 } 97 106 } 98 107 99 $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) ); 100 if ( $tags_list ) { 101 printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 102 _x( 'Tags', 'Used before tag names.', 'twentyfifteen' ), 103 $tags_list 108 if ( is_attachment() && wp_attachment_is_image() ) { 109 // Retrieve attachment metadata. 110 $metadata = wp_get_attachment_metadata(); 111 112 printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', 113 _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ), 114 esc_url( wp_get_attachment_url() ), 115 $metadata['width'], 116 $metadata['height'] 104 117 ); 105 118 } 106 }107 119 108 if ( is_attachment() && wp_attachment_is_image() ) { 109 // Retrieve attachment metadata. 110 $metadata = wp_get_attachment_metadata(); 111 112 printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', 113 _x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ), 114 esc_url( wp_get_attachment_url() ), 115 $metadata['width'], 116 $metadata['height'] 117 ); 118 } 119 120 if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 121 echo '<span class="comments-link">'; 122 /* translators: %s: post title */ 123 comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) ); 124 echo '</span>'; 120 if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 121 echo '<span class="comments-link">'; 122 /* translators: %s: post title */ 123 comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) ); 124 echo '</span>'; 125 } 125 126 } 126 }127 127 endif; 128 128 129 129 /** … … 172 172 add_action( 'save_post', 'twentyfifteen_category_transient_flusher' ); 173 173 174 174 if ( ! function_exists( 'twentyfifteen_post_thumbnail' ) ) : 175 /**175 /** 176 176 * Display an optional post thumbnail. 177 177 * 178 178 * Wraps the post thumbnail in an anchor element on index views, or a div … … 180 180 * 181 181 * @since Twenty Fifteen 1.0 182 182 */ 183 function twentyfifteen_post_thumbnail() {184 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {185 return;186 }183 function twentyfifteen_post_thumbnail() { 184 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { 185 return; 186 } 187 187 188 if ( is_singular() ) :189 ?>188 if ( is_singular() ) : 189 ?> 190 190 191 <div class="post-thumbnail">191 <div class="post-thumbnail"> 192 192 <?php the_post_thumbnail(); ?> 193 193 </div><!-- .post-thumbnail --> 194 194 … … 201 201 </a> 202 202 203 203 <?php endif; // End is_singular() 204 }204 } 205 205 endif; 206 206 207 207 if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) : 208 /**208 /** 209 209 * Return the post URL. 210 210 * 211 211 * Falls back to the post permalink if no URL is found in the post. … … 216 216 * 217 217 * @return string The Link format URL. 218 218 */ 219 function twentyfifteen_get_link_url() {220 $has_url = get_url_in_content( get_the_content() );219 function twentyfifteen_get_link_url() { 220 $has_url = get_url_in_content( get_the_content() ); 221 221 222 return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() );223 }222 return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() ); 223 } 224 224 endif; 225 225 226 226 if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) : 227 /**227 /** 228 228 * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link. 229 229 * 230 230 * @since Twenty Fifteen 1.0 231 231 * 232 232 * @return string 'Continue reading' link prepended with an ellipsis. 233 233 */ 234 function twentyfifteen_excerpt_more( $more ) {235 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',236 esc_url( get_permalink( get_the_ID() ) ),237 /* translators: %s: Name of current post */238 sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )234 function twentyfifteen_excerpt_more( $more ) { 235 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', 236 esc_url( get_permalink( get_the_ID() ) ), 237 /* translators: %s: Name of current post */ 238 sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) 239 239 ); 240 return ' … ' . $link;241 }242 add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );240 return ' … ' . $link; 241 } 242 add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' ); 243 243 endif; 244 244 245 245 if ( ! function_exists( 'twentyfifteen_the_custom_logo' ) ) : 246 /**246 /** 247 247 * Displays the optional custom logo. 248 248 * 249 249 * Does nothing if the custom logo is not available. 250 250 * 251 251 * @since Twenty Fifteen 1.5 252 252 */ 253 function twentyfifteen_the_custom_logo() { 254 if ( function_exists( 'the_custom_logo' ) ) { 255 the_custom_logo(); 253 function twentyfifteen_the_custom_logo() { 254 if ( function_exists( 'the_custom_logo' ) ) { 255 the_custom_logo(); 256 } 256 257 } 257 }258 258 endif; -
src/wp-content/themes/twentyfifteen/index.php
38 38 */ 39 39 get_template_part( 'content', get_post_format() ); 40 40 41 // End the loop.41 // End the loop. 42 42 endwhile; 43 43 44 44 // Previous/next page navigation. … … 48 48 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', 49 49 ) ); 50 50 51 // If no content, include the "No posts found" template.51 // If no content, include the "No posts found" template. 52 52 else : 53 53 get_template_part( 'content', 'none' ); 54 54 -
src/wp-content/themes/twentyfifteen/page.php
28 28 comments_template(); 29 29 endif; 30 30 31 // End the loop.31 // End the loop. 32 32 endwhile; 33 33 ?> 34 34 -
src/wp-content/themes/twentyfifteen/search.php
30 30 */ 31 31 get_template_part( 'content', 'search' ); 32 32 33 // End the loop.33 // End the loop. 34 34 endwhile; 35 35 36 36 // Previous/next page navigation. … … 40 40 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>', 41 41 ) ); 42 42 43 // If no content, include the "No posts found" template.43 // If no content, include the "No posts found" template. 44 44 else : 45 45 get_template_part( 'content', 'none' ); 46 46 -
src/wp-content/themes/twentyfifteen/sidebar.php
7 7 * @since Twenty Fifteen 1.0 8 8 */ 9 9 10 if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) 10 if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) ) : ?> 11 11 <div id="secondary" class="secondary"> 12 12 13 13 <?php if ( has_nav_menu( 'primary' ) ) : ?> -
src/wp-content/themes/twentyfifteen/single.php
38 38 '<span class="post-title">%title</span>', 39 39 ) ); 40 40 41 // End the loop.41 // End the loop. 42 42 endwhile; 43 43 ?> 44 44 -
src/wp-content/themes/twentyfourteen/archive.php
27 27 <header class="page-header"> 28 28 <h1 class="page-title"> 29 29 <?php 30 31 30 if ( is_day() ) : 31 printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() ); 32 32 33 33 elseif ( is_month() ) : 34 34 printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) ); … … 46 46 47 47 <?php 48 48 // Start the Loop. 49 49 while ( have_posts() ) : the_post(); 50 50 51 52 53 54 55 56 51 /* 52 * Include the post format-specific template for the content. If you want to 53 * use this in a child theme, then include a file called called content-___.php 54 * (where ___ is the post format) and that will be used instead. 55 */ 56 get_template_part( 'content', get_post_format() ); 57 57 58 58 endwhile; 59 59 // Previous/next page navigation. -
src/wp-content/themes/twentyfourteen/author.php
45 45 rewind_posts(); 46 46 47 47 // Start the Loop. 48 48 while ( have_posts() ) : the_post(); 49 49 50 51 52 53 54 55 50 /* 51 * Include the post format-specific template for the content. If you want to 52 * use this in a child theme, then include a file called called content-___.php 53 * (where ___ is the post format) and that will be used instead. 54 */ 55 get_template_part( 'content', get_post_format() ); 56 56 57 57 endwhile; 58 58 // Previous/next page navigation. -
src/wp-content/themes/twentyfourteen/category.php
22 22 <?php 23 23 // Show an optional term description. 24 24 $term_description = term_description(); 25 26 25 if ( ! empty( $term_description ) ) : 26 printf( '<div class="taxonomy-description">%s</div>', $term_description ); 27 27 endif; 28 28 ?> 29 29 </header><!-- .archive-header --> 30 30 31 31 <?php 32 32 // Start the Loop. 33 33 while ( have_posts() ) : the_post(); 34 34 35 36 37 38 39 40 35 /* 36 * Include the post format-specific template for the content. If you want to 37 * use this in a child theme, then include a file called called content-___.php 38 * (where ___ is the post format) and that will be used instead. 39 */ 40 get_template_part( 'content', get_post_format() ); 41 41 42 42 endwhile; 43 43 // Previous/next page navigation. -
src/wp-content/themes/twentyfourteen/comments.php
25 25 <h2 class="comments-title"> 26 26 <?php 27 27 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyfourteen' ), 28 28 number_format_i18n( get_comments_number() ), get_the_title() ); 29 29 ?> 30 30 </h2> 31 31 -
src/wp-content/themes/twentyfourteen/content-aside.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-audio.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-featured-post.php
12 12 <a class="post-thumbnail" href="<?php the_permalink(); ?>"> 13 13 <?php 14 14 // Output the featured image. 15 16 17 18 19 20 15 if ( has_post_thumbnail() ) : 16 if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) { 17 the_post_thumbnail(); 18 } else { 19 the_post_thumbnail( 'twentyfourteen-full-width' ); 20 } 21 21 endif; 22 22 ?> 23 23 </a> -
src/wp-content/themes/twentyfourteen/content-gallery.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-image.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-link.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-quote.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content-video.php
19 19 <?php 20 20 endif; 21 21 22 23 22 if ( is_single() ) : 23 the_title( '<h1 class="entry-title">', '</h1>' ); 24 24 else : 25 25 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 26 26 endif; -
src/wp-content/themes/twentyfourteen/content.php
21 21 <?php 22 22 endif; 23 23 24 25 24 if ( is_single() ) : 25 the_title( '<h1 class="entry-title">', '</h1>' ); 26 26 else : 27 27 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 28 28 endif; … … 30 30 31 31 <div class="entry-meta"> 32 32 <?php 33 if ( 'post' == get_post_type() ) 34 twentyfourteen_posted_on(); 33 if ( 'post' == get_post_type() ) { 34 twentyfourteen_posted_on(); 35 } 35 36 36 37 if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : 37 38 ?> 38 39 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> 39 40 <?php -
src/wp-content/themes/twentyfourteen/featured-content.php
19 19 do_action( 'twentyfourteen_featured_posts_before' ); 20 20 21 21 $featured_posts = twentyfourteen_get_featured_posts(); 22 23 22 foreach ( (array) $featured_posts as $order => $post ) : 23 setup_postdata( $post ); 24 24 25 26 25 // Include the featured content template. 26 get_template_part( 'content', 'featured-post' ); 27 27 endforeach; 28 28 29 29 /** -
src/wp-content/themes/twentyfourteen/footer.php
25 25 26 26 <?php wp_footer(); ?> 27 27 </body> 28 </html> 29 No newline at end of file 28 </html> -
src/wp-content/themes/twentyfourteen/functions.php
44 44 } 45 45 46 46 if ( ! function_exists( 'twentyfourteen_setup' ) ) : 47 /**47 /** 48 48 * Twenty Fourteen setup. 49 49 * 50 50 * Set up theme defaults and registers support for various WordPress features. … … 55 55 * 56 56 * @since Twenty Fourteen 1.0 57 57 */ 58 function twentyfourteen_setup() { 59 60 /* 61 * Make Twenty Fourteen available for translation. 62 * 63 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen 64 * If you're building a theme based on Twenty Fourteen, use a find and 65 * replace to change 'twentyfourteen' to the name of your theme in all 66 * template files. 67 */ 68 load_theme_textdomain( 'twentyfourteen' ); 69 70 // This theme styles the visual editor to resemble the theme style. 71 add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); 72 73 // Add RSS feed links to <head> for posts and comments. 74 add_theme_support( 'automatic-feed-links' ); 75 76 // Enable support for Post Thumbnails, and declare two sizes. 77 add_theme_support( 'post-thumbnails' ); 78 set_post_thumbnail_size( 672, 372, true ); 79 add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); 80 81 // This theme uses wp_nav_menu() in two locations. 82 register_nav_menus( array( 83 'primary' => __( 'Top primary menu', 'twentyfourteen' ), 84 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), 85 ) ); 86 87 /* 88 * Switch default core markup for search form, comment form, and comments 89 * to output valid HTML5. 90 */ 91 add_theme_support( 'html5', array( 92 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' 93 ) ); 58 function twentyfourteen_setup() { 94 59 95 /* 96 * Enable support for Post Formats. 97 * See https://codex.wordpress.org/Post_Formats 98 */ 99 add_theme_support( 'post-formats', array( 100 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery', 101 ) ); 60 /* 61 * Make Twenty Fourteen available for translation. 62 * 63 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen 64 * If you're building a theme based on Twenty Fourteen, use a find and 65 * replace to change 'twentyfourteen' to the name of your theme in all 66 * template files. 67 */ 68 load_theme_textdomain( 'twentyfourteen' ); 69 70 // This theme styles the visual editor to resemble the theme style. 71 add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); 72 73 // Add RSS feed links to <head> for posts and comments. 74 add_theme_support( 'automatic-feed-links' ); 75 76 // Enable support for Post Thumbnails, and declare two sizes. 77 add_theme_support( 'post-thumbnails' ); 78 set_post_thumbnail_size( 672, 372, true ); 79 add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); 80 81 // This theme uses wp_nav_menu() in two locations. 82 register_nav_menus( array( 83 'primary' => __( 'Top primary menu', 'twentyfourteen' ), 84 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), 85 ) ); 102 86 103 // This theme allows users to set a custom background. 104 add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( 105 'default-color' => 'f5f5f5', 106 ) ) ); 107 108 // Add support for featured content. 109 add_theme_support( 'featured-content', array( 110 'featured_content_filter' => 'twentyfourteen_get_featured_posts', 111 'max_posts' => 6, 112 ) ); 87 /* 88 * Switch default core markup for search form, comment form, and comments 89 * to output valid HTML5. 90 */ 91 add_theme_support( 'html5', array( 92 'search-form', 93 'comment-form', 94 'comment-list', 95 'gallery', 96 'caption', 97 ) ); 98 99 /* 100 * Enable support for Post Formats. 101 * See https://codex.wordpress.org/Post_Formats 102 */ 103 add_theme_support( 'post-formats', array( 104 'aside', 105 'image', 106 'video', 107 'audio', 108 'quote', 109 'link', 110 'gallery', 111 ) ); 112 113 // This theme allows users to set a custom background. 114 add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( 115 'default-color' => 'f5f5f5', 116 ) ) ); 117 118 // Add support for featured content. 119 add_theme_support( 'featured-content', array( 120 'featured_content_filter' => 'twentyfourteen_get_featured_posts', 121 'max_posts' => 6, 122 ) ); 113 123 114 // This theme uses its own gallery styles.115 add_filter( 'use_default_gallery_style', '__return_false' );124 // This theme uses its own gallery styles. 125 add_filter( 'use_default_gallery_style', '__return_false' ); 116 126 117 // Indicate widget sidebars can use selective refresh in the Customizer.118 add_theme_support( 'customize-selective-refresh-widgets' );119 }127 // Indicate widget sidebars can use selective refresh in the Customizer. 128 add_theme_support( 'customize-selective-refresh-widgets' ); 129 } 120 130 endif; // twentyfourteen_setup 121 131 add_action( 'after_setup_theme', 'twentyfourteen_setup' ); 122 132 … … 259 269 wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); 260 270 wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( 261 271 'prevText' => __( 'Previous', 'twentyfourteen' ), 262 'nextText' => __( 'Next', 'twentyfourteen' ) 272 'nextText' => __( 'Next', 'twentyfourteen' ), 263 273 ) ); 264 274 } 265 275 … … 303 313 add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); 304 314 305 315 if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : 306 /**316 /** 307 317 * Print the attached image with a link to the next attached image. 308 318 * 309 319 * @since Twenty Fourteen 1.0 310 320 */ 311 function twentyfourteen_the_attached_image() {312 $post = get_post();313 /**321 function twentyfourteen_the_attached_image() { 322 $post = get_post(); 323 /** 314 324 * Filter the default Twenty Fourteen attachment size. 315 325 * 316 326 * @since Twenty Fourteen 1.0 … … 322 332 * @type int $width Width of the image in pixels. Default 810. 323 333 * } 324 334 */ 325 $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) );326 $next_attachment_url = wp_get_attachment_url();335 $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); 336 $next_attachment_url = wp_get_attachment_url(); 327 337 328 /*329 * Grab the IDs of all the image attachments in a gallery so we can get the URL330 * of the next adjacent image in a gallery, or the first image (if we're331 * looking at the last image in a gallery), or, in a gallery of one, just the332 * link to that image file.333 */334 $attachment_ids = get_posts( array(335 'post_parent' => $post->post_parent,336 'fields' => 'ids',337 'numberposts' => -1,338 'post_status' => 'inherit',339 'post_type' => 'attachment',340 'post_mime_type' => 'image',341 'order' => 'ASC',342 'orderby' => 'menu_order ID',343 ) );338 /* 339 * Grab the IDs of all the image attachments in a gallery so we can get the URL 340 * of the next adjacent image in a gallery, or the first image (if we're 341 * looking at the last image in a gallery), or, in a gallery of one, just the 342 * link to that image file. 343 */ 344 $attachment_ids = get_posts( array( 345 'post_parent' => $post->post_parent, 346 'fields' => 'ids', 347 'numberposts' => -1, 348 'post_status' => 'inherit', 349 'post_type' => 'attachment', 350 'post_mime_type' => 'image', 351 'order' => 'ASC', 352 'orderby' => 'menu_order ID', 353 ) ); 344 354 345 // If there is more than 1 attachment in a gallery... 346 if ( count( $attachment_ids ) > 1 ) { 347 foreach ( $attachment_ids as $idx => $attachment_id ) { 348 if ( $attachment_id == $post->ID ) { 349 $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; 350 break; 355 // If there is more than 1 attachment in a gallery... 356 if ( count( $attachment_ids ) > 1 ) { 357 foreach ( $attachment_ids as $idx => $attachment_id ) { 358 if ( $attachment_id == $post->ID ) { 359 $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; 360 break; 361 } 351 362 } 352 }353 363 354 // get the URL of the next image attachment... 355 if ( $next_id ) { 356 $next_attachment_url = get_attachment_link( $next_id ); 364 // get the URL of the next image attachment... 365 if ( $next_id ) { 366 $next_attachment_url = get_attachment_link( $next_id ); 367 } // End if(). 368 else { 369 $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); 370 } 357 371 } 358 372 359 // or get the URL of the first image attachment.360 else {361 $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );362 }373 printf( '<a href="%1$s" rel="attachment">%2$s</a>', 374 esc_url( $next_attachment_url ), 375 wp_get_attachment_image( $post->ID, $attachment_size ) 376 ); 363 377 } 364 365 printf( '<a href="%1$s" rel="attachment">%2$s</a>',366 esc_url( $next_attachment_url ),367 wp_get_attachment_image( $post->ID, $attachment_size )368 );369 }370 378 endif; 371 379 372 380 if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : 373 /**381 /** 374 382 * Print a list of all site contributors who published at least one post. 375 383 * 376 384 * @since Twenty Fourteen 1.0 377 385 */ 378 function twentyfourteen_list_authors() {379 $contributor_ids = get_users( array(380 'fields' => 'ID',381 'orderby' => 'post_count',382 'order' => 'DESC',383 'who' => 'authors',384 ) );386 function twentyfourteen_list_authors() { 387 $contributor_ids = get_users( array( 388 'fields' => 'ID', 389 'orderby' => 'post_count', 390 'order' => 'DESC', 391 'who' => 'authors', 392 ) ); 385 393 386 foreach ( $contributor_ids as $contributor_id ) :387 $post_count = count_user_posts( $contributor_id );394 foreach ( $contributor_ids as $contributor_id ) : 395 $post_count = count_user_posts( $contributor_id ); 388 396 389 // Move on if user has not published a post (yet).390 if ( ! $post_count ) {391 continue;392 }393 ?>397 // Move on if user has not published a post (yet). 398 if ( ! $post_count ) { 399 continue; 400 } 401 ?> 394 402 395 <div class="contributor">396 <div class="contributor-info">403 <div class="contributor"> 404 <div class="contributor-info"> 397 405 <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div> 398 406 <div class="contributor-summary"> 399 407 <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2> 400 408 <p class="contributor-bio"> 401 409 <?php echo get_the_author_meta( 'description', $contributor_id ); ?> 402 410 </p> 403 411 <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>"> 404 412 <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?> 405 413 </a> 406 414 </div><!-- .contributor-summary --> 407 </div><!-- .contributor-info -->408 </div><!-- .contributor -->415 </div><!-- .contributor-info --> 416 </div><!-- .contributor --> 409 417 410 <?php411 endforeach;412 }418 <?php 419 endforeach; 420 } 413 421 endif; 414 422 415 423 /** … … 553 561 * `is_customize_preview` function was introduced. 554 562 */ 555 563 if ( ! function_exists( 'is_customize_preview' ) ) : 556 function is_customize_preview() {557 global $wp_customize;564 function is_customize_preview() { 565 global $wp_customize; 558 566 559 return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();560 }567 return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview(); 568 } 561 569 endif; -
src/wp-content/themes/twentyfourteen/image.php
18 18 19 19 <?php 20 20 // Start the Loop. 21 21 while ( have_posts() ) : the_post(); 22 22 ?> 23 24 25 23 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 24 <header class="entry-header"> 25 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> 26 26 27 27 <div class="entry-meta"> 28 28 29 29 <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span> 30 30 31 31 <span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> × <?php echo esc_html( $metadata['height'] ); ?></a></span> 32 32 33 34 35 36 33 <span class="parent-post-link"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span> 34 <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?> 35 </div><!-- .entry-meta --> 36 </header><!-- .entry-header --> 37 37 38 39 40 41 42 38 <div class="entry-content"> 39 <div class="entry-attachment"> 40 <div class="attachment"> 41 <?php twentyfourteen_the_attached_image(); ?> 42 </div><!-- .attachment --> 43 43 44 44 <?php if ( has_excerpt() ) : ?> 45 45 <div class="entry-caption"> 46 46 <?php the_excerpt(); ?> 47 47 </div><!-- .entry-caption --> 48 48 <?php endif; ?> 49 49 </div><!-- .entry-attachment --> 50 50 51 52 53 54 55 56 57 58 59 60 51 <?php 52 the_content(); 53 wp_link_pages( array( 54 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 55 'after' => '</div>', 56 'link_before' => '<span>', 57 'link_after' => '</span>', 58 ) ); 59 ?> 60 </div><!-- .entry-content --> 61 61 </article><!-- #post-## --> 62 62 63 63 <nav id="image-navigation" class="navigation image-navigation"> 64 65 64 <div class="nav-links"> 65 <?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?> 66 66 <?php next_image_link( false, '<div class="next-image">' . __( 'Next Image', 'twentyfourteen' ) . '</div>' ); ?> 67 67 </div><!-- .nav-links --> 68 68 </nav><!-- #image-navigation --> -
src/wp-content/themes/twentyfourteen/inc/custom-header.php
48 48 add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); 49 49 50 50 if ( ! function_exists( 'twentyfourteen_header_style' ) ) : 51 /**51 /** 52 52 * Styles the header image and text displayed on the blog 53 53 * 54 54 * @see twentyfourteen_custom_header_setup(). 55 55 * 56 56 */ 57 function twentyfourteen_header_style() {58 $text_color = get_header_textcolor();57 function twentyfourteen_header_style() { 58 $text_color = get_header_textcolor(); 59 59 60 // If no custom color for text is set, let's bail. 61 if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) 62 return; 60 // If no custom color for text is set, let's bail. 61 if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { 62 return; 63 } 63 64 64 // If we get this far, we have custom styles.65 ?>66 <style type="text/css" id="twentyfourteen-header-css">67 <?php65 // If we get this far, we have custom styles. 66 ?> 67 <style type="text/css" id="twentyfourteen-header-css"> 68 <?php 68 69 // Has the text been hidden? 69 70 if ( ! display_header_text() ) : 70 71 ?> … … 84 85 <?php endif; ?> 85 86 </style> 86 87 <?php 87 }88 } 88 89 endif; // twentyfourteen_header_style 89 90 90 91 91 92 if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : 92 /**93 /** 93 94 * Style the header image displayed on the Appearance > Header screen. 94 95 * 95 96 * @see twentyfourteen_custom_header_setup() 96 97 * 97 98 * @since Twenty Fourteen 1.0 98 99 */ 99 function twentyfourteen_admin_header_style() {100 ?>101 <style type="text/css" id="twentyfourteen-admin-header-css">102 .appearance_page_custom-header #headimg {100 function twentyfourteen_admin_header_style() { 101 ?> 102 <style type="text/css" id="twentyfourteen-admin-header-css"> 103 .appearance_page_custom-header #headimg { 103 104 background-color: #000; 104 105 border: none; 105 106 max-width: 1260px; 106 107 min-height: 48px; 107 }108 #headimg h1 {108 } 109 #headimg h1 { 109 110 font-family: Lato, sans-serif; 110 111 font-size: 18px; 111 112 line-height: 48px; 112 113 margin: 0 0 0 30px; 113 }114 .rtl #headimg h1 {114 } 115 .rtl #headimg h1 { 115 116 margin: 0 30px 0 0; 116 }117 #headimg h1 a {117 } 118 #headimg h1 a { 118 119 color: #fff; 119 120 text-decoration: none; 120 }121 #headimg img {121 } 122 #headimg img { 122 123 vertical-align: middle; 124 } 125 </style> 126 <?php 123 127 } 124 </style>125 <?php126 }127 128 endif; // twentyfourteen_admin_header_style 128 129 129 130 if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : 130 /**131 /** 131 132 * Create the custom header image markup displayed on the Appearance > Header screen. 132 133 * 133 134 * @see twentyfourteen_custom_header_setup() 134 135 * 135 136 * @since Twenty Fourteen 1.0 136 137 */ 137 function twentyfourteen_admin_header_image() {138 ?>139 <div id="headimg">138 function twentyfourteen_admin_header_image() { 139 ?> 140 <div id="headimg"> 140 141 <?php if ( get_header_image() ) : ?> 141 142 <img src="<?php header_image(); ?>" alt=""> 142 143 <?php endif; ?> 143 144 <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( sprintf( 'color: #%s;', get_header_textcolor() ) ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> 144 145 </div> 145 <?php146 }146 <?php 147 } 147 148 endif; // twentyfourteen_admin_header_image -
src/wp-content/themes/twentyfourteen/inc/featured-content.php
83 83 self::$max_posts = absint( $theme_support[0]['max_posts'] ); 84 84 } 85 85 86 add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) 86 add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); 87 87 add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); 88 add_action( 'admin_init', array( __CLASS__, 'register_setting' ));89 add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ));90 add_action( 'save_post', array( __CLASS__, 'delete_transient' ));91 add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ));92 add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ));93 add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ));94 add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ));88 add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); 89 add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); 90 add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); 91 add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); 92 add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); 93 add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); 94 add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); 95 95 } 96 96 97 97 /** … … 106 106 */ 107 107 public static function wp_loaded() { 108 108 if ( self::get_setting( 'hide-tag' ) ) { 109 add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' 109 add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); 110 110 add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 ); 111 111 } 112 112 } -
src/wp-content/themes/twentyfourteen/inc/template-tags.php
8 8 */ 9 9 10 10 if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) : 11 /**11 /** 12 12 * Display navigation to next/previous set of posts when applicable. 13 13 * 14 14 * @since Twenty Fourteen 1.0 … … 16 16 * @global WP_Query $wp_query WordPress Query object. 17 17 * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. 18 18 */ 19 function twentyfourteen_paging_nav() {20 global $wp_query, $wp_rewrite;19 function twentyfourteen_paging_nav() { 20 global $wp_query, $wp_rewrite; 21 21 22 // Don't print empty markup if there's only one page. 23 if ( $wp_query->max_num_pages < 2 ) { 24 return; 25 } 26 27 $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; 28 $pagenum_link = html_entity_decode( get_pagenum_link() ); 29 $query_args = array(); 30 $url_parts = explode( '?', $pagenum_link ); 31 32 if ( isset( $url_parts[1] ) ) { 33 wp_parse_str( $url_parts[1], $query_args ); 34 } 35 36 $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); 37 $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; 38 39 $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; 40 $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; 41 42 // Set up paginated links. 43 $links = paginate_links( array( 44 'base' => $pagenum_link, 45 'format' => $format, 46 'total' => $wp_query->max_num_pages, 47 'current' => $paged, 48 'mid_size' => 1, 49 'add_args' => array_map( 'urlencode', $query_args ), 50 'prev_text' => __( '← Previous', 'twentyfourteen' ), 51 'next_text' => __( 'Next →', 'twentyfourteen' ), 52 ) ); 22 // Don't print empty markup if there's only one page. 23 if ( $wp_query->max_num_pages < 2 ) { 24 return; 25 } 53 26 54 if ( $links ) : 27 $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; 28 $pagenum_link = html_entity_decode( get_pagenum_link() ); 29 $query_args = array(); 30 $url_parts = explode( '?', $pagenum_link ); 55 31 56 ?> 57 <nav class="navigation paging-navigation" role="navigation"> 58 <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentyfourteen' ); ?></h1> 59 <div class="pagination loop-pagination"> 32 if ( isset( $url_parts[1] ) ) { 33 wp_parse_str( $url_parts[1], $query_args ); 34 } 35 36 $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); 37 $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; 38 39 $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; 40 $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; 41 42 // Set up paginated links. 43 $links = paginate_links( array( 44 'base' => $pagenum_link, 45 'format' => $format, 46 'total' => $wp_query->max_num_pages, 47 'current' => $paged, 48 'mid_size' => 1, 49 'add_args' => array_map( 'urlencode', $query_args ), 50 'prev_text' => __( '← Previous', 'twentyfourteen' ), 51 'next_text' => __( 'Next →', 'twentyfourteen' ), 52 ) ); 53 54 if ( $links ) : 55 56 ?> 57 <nav class="navigation paging-navigation" role="navigation"> 58 <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentyfourteen' ); ?></h1> 59 <div class="pagination loop-pagination"> 60 60 <?php echo $links; ?> 61 </div><!-- .pagination -->62 </nav><!-- .navigation -->63 <?php64 endif;65 }61 </div><!-- .pagination --> 62 </nav><!-- .navigation --> 63 <?php 64 endif; 65 } 66 66 endif; 67 67 68 68 if ( ! function_exists( 'twentyfourteen_post_nav' ) ) : 69 /**69 /** 70 70 * Display navigation to next/previous post when applicable. 71 71 * 72 72 * @since Twenty Fourteen 1.0 73 73 */ 74 function twentyfourteen_post_nav() {75 // Don't print empty markup if there's nowhere to navigate.76 $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );77 $next = get_adjacent_post( false, '', false );74 function twentyfourteen_post_nav() { 75 // Don't print empty markup if there's nowhere to navigate. 76 $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); 77 $next = get_adjacent_post( false, '', false ); 78 78 79 if ( ! $next && ! $previous ) {80 return;81 }79 if ( ! $next && ! $previous ) { 80 return; 81 } 82 82 83 ?>84 <nav class="navigation post-navigation" role="navigation">83 ?> 84 <nav class="navigation post-navigation" role="navigation"> 85 85 <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1> 86 86 <div class="nav-links"> 87 87 <?php 88 88 if ( is_attachment() ) : 89 89 previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) ); 90 else :91 previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) );92 next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) );93 endif;94 ?>95 </div><!-- .nav-links -->96 </nav><!-- .navigation -->97 <?php98 }90 else : 91 previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) ); 92 next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) ); 93 endif; 94 ?> 95 </div><!-- .nav-links --> 96 </nav><!-- .navigation --> 97 <?php 98 } 99 99 endif; 100 100 101 101 if ( ! function_exists( 'twentyfourteen_posted_on' ) ) : 102 /**102 /** 103 103 * Print HTML with meta information for the current post-date/time and author. 104 104 * 105 105 * @since Twenty Fourteen 1.0 106 106 */ 107 function twentyfourteen_posted_on() {108 if ( is_sticky() && is_home() && ! is_paged() ) {109 echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';110 }107 function twentyfourteen_posted_on() { 108 if ( is_sticky() && is_home() && ! is_paged() ) { 109 echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>'; 110 } 111 111 112 // Set up and print post meta information.113 printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',114 esc_url( get_permalink() ),115 esc_attr( get_the_date( 'c' ) ),116 esc_html( get_the_date() ),117 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),118 get_the_author()119 );120 }112 // Set up and print post meta information. 113 printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', 114 esc_url( get_permalink() ), 115 esc_attr( get_the_date( 'c' ) ), 116 esc_html( get_the_date() ), 117 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 118 get_the_author() 119 ); 120 } 121 121 endif; 122 122 123 123 /** … … 162 162 add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); 163 163 164 164 if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) : 165 /**165 /** 166 166 * Display an optional post thumbnail. 167 167 * 168 168 * Wraps the post thumbnail in an anchor element on index … … 171 171 * @since Twenty Fourteen 1.0 172 172 * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. 173 173 */ 174 function twentyfourteen_post_thumbnail() {175 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {176 return;177 }174 function twentyfourteen_post_thumbnail() { 175 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { 176 return; 177 } 178 178 179 if ( is_singular() ) :180 ?>179 if ( is_singular() ) : 180 ?> 181 181 182 <div class="post-thumbnail">183 <?php182 <div class="post-thumbnail"> 183 <?php 184 184 if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { 185 185 the_post_thumbnail( 'twentyfourteen-full-width' ); 186 186 } else { 187 187 the_post_thumbnail(); 188 188 } 189 ?>190 </div>189 ?> 190 </div> 191 191 192 <?php else : ?>192 <?php else : ?> 193 193 194 194 <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> 195 195 <?php 196 if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { 197 the_post_thumbnail( 'twentyfourteen-full-width' ); 198 } else { 199 the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); 200 } 196 if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) { 197 the_post_thumbnail( 'twentyfourteen-full-width' ); 198 } else { 199 the_post_thumbnail( 'post-thumbnail', array( 200 'alt' => get_the_title(), 201 ) ); 202 } 201 203 ?> 202 204 </a> 203 205 204 206 <?php endif; // End is_singular() 205 }207 } 206 208 endif; 207 209 208 210 if ( ! function_exists( 'twentyfourteen_excerpt_more' ) && ! is_admin() ) : 209 /**211 /** 210 212 * Replaces "[...]" (appended to automatically generated excerpts) with ... 211 213 * and a Continue reading link. 212 214 * … … 215 217 * @param string $more Default Read More excerpt link. 216 218 * @return string Filtered Read More excerpt link. 217 219 */ 218 function twentyfourteen_excerpt_more( $more ) {219 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',220 esc_url( get_permalink( get_the_ID() ) ),220 function twentyfourteen_excerpt_more( $more ) { 221 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', 222 esc_url( get_permalink( get_the_ID() ) ), 221 223 /* translators: %s: Name of current post */ 222 224 sprintf( __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentyfourteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) 223 225 ); 224 return ' … ' . $link;225 }226 add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' );226 return ' … ' . $link; 227 } 228 add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); 227 229 endif; -
src/wp-content/themes/twentyfourteen/inc/widgets.php
133 133 <ol> 134 134 135 135 <?php 136 137 138 139 136 while ( $ephemera->have_posts() ) : 137 $ephemera->the_post(); 138 $tmp_more = $GLOBALS['more']; 139 $GLOBALS['more'] = 0; 140 140 ?> 141 141 <li> 142 142 <article <?php post_class(); ?>> 143 <div class="entry-content"> 144 <?php 145 if ( has_post_format( 'gallery' ) ) : 143 <div class="entry-content"> 144 <?php 145 if ( has_post_format( 'gallery' ) ) : 146 147 if ( post_password_required() ) : 148 the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); 149 else : 150 $images = array(); 151 152 $galleries = get_post_galleries( get_the_ID(), false ); 153 if ( isset( $galleries[0]['ids'] ) ) { 154 $images = explode( ',', $galleries[0]['ids'] ); 155 } 156 157 if ( ! $images ) : 158 $images = get_posts( array( 159 'fields' => 'ids', 160 'numberposts' => -1, 161 'order' => 'ASC', 162 'orderby' => 'menu_order', 163 'post_mime_type' => 'image', 164 'post_parent' => get_the_ID(), 165 'post_type' => 'attachment', 166 ) ); 167 endif; 146 168 147 if ( post_password_required() ) : 148 the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); 149 else : 150 $images = array(); 151 152 $galleries = get_post_galleries( get_the_ID(), false ); 153 if ( isset( $galleries[0]['ids'] ) ) 154 $images = explode( ',', $galleries[0]['ids'] ); 155 156 if ( ! $images ) : 157 $images = get_posts( array( 158 'fields' => 'ids', 159 'numberposts' => -1, 160 'order' => 'ASC', 161 'orderby' => 'menu_order', 162 'post_mime_type' => 'image', 163 'post_parent' => get_the_ID(), 164 'post_type' => 'attachment', 165 ) ); 166 endif; 167 168 $total_images = count( $images ); 169 170 if ( has_post_thumbnail() ) : 171 $post_thumbnail = get_the_post_thumbnail(); 172 elseif ( $total_images > 0 ) : 173 $image = reset( $images ); 174 $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); 175 endif; 169 $total_images = count( $images ); 176 170 177 if ( ! empty ( $post_thumbnail ) ) : 171 if ( has_post_thumbnail() ) : 172 $post_thumbnail = get_the_post_thumbnail(); 173 elseif ( $total_images > 0 ) : 174 $image = reset( $images ); 175 $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); 176 endif; 177 178 if ( ! empty( $post_thumbnail ) ) : 178 179 ?> 179 180 <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a> 180 181 <?php endif; ?> 181 182 <p class="wp-caption-text"> 182 183