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 184 185 186 187 188 189 190 183 <?php 184 printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ), 185 esc_url( get_permalink() ), 186 number_format_i18n( $total_images ) 187 ); 188 ?> 189 </p> 190 <?php 191 endif; 191 192 192 193 193 else : 194 the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) ); 194 195 endif; 195 196 ?> 196 197 </div><!-- .entry-content --> 197 198 198 199 <header class="entry-header"> 199 200 <div class="entry-meta"> 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 201 <?php 202 if ( ! has_post_format( 'link' ) ) : 203 the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); 204 endif; 205 206 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>', 207 esc_url( get_permalink() ), 208 esc_attr( get_the_date( 'c' ) ), 209 esc_html( get_the_date() ), 210 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 211 get_the_author() 212 ); 213 214 if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : 215 ?> 216 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span> 216 217 <?php endif; ?> 217 218 </div><!-- .entry-meta --> 218 219 </header><!-- .entry-header --> -
src/wp-content/themes/twentyfourteen/index.php
19 19 <div id="main-content" class="main-content"> 20 20 21 21 <?php 22 23 24 25 22 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 23 // Include the featured content template. 24 get_template_part( 'featured-content' ); 25 } 26 26 ?> 27 27 28 28 <div id="primary" class="content-area"> 29 29 <div id="content" class="site-content" role="main"> 30 30 31 31 <?php 32 33 34 35 36 37 38 39 40 41 32 if ( have_posts() ) : 33 // Start the Loop. 34 while ( have_posts() ) : the_post(); 35 36 /* 37 * Include the post format-specific template for the content. If you want to 38 * use this in a child theme, then include a file called called content-___.php 39 * (where ___ is the post format) and that will be used instead. 40 */ 41 get_template_part( 'content', get_post_format() ); 42 42 43 43 endwhile; 44 45 44 // Previous/next post navigation. 45 twentyfourteen_paging_nav(); 46 46 47 47 else : 48 48 // If no content, include the "No posts found" template. -
src/wp-content/themes/twentyfourteen/page-templates/contributors.php
12 12 <div id="main-content" class="main-content"> 13 13 14 14 <?php 15 16 17 18 15 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 16 // Include the featured content template. 17 get_template_part( 'featured-content' ); 18 } 19 19 ?> 20 20 21 21 <div id="primary" class="content-area"> 22 22 <div id="content" class="site-content" role="main"> 23 23 <?php 24 24 // Start the Loop. 25 25 while ( have_posts() ) : the_post(); 26 26 ?> 27 27 28 28 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 29 30 29 <?php 30 the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); 31 31 32 33 32 // Output the authors list. 33 twentyfourteen_list_authors(); 34 34 35 36 35 edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); 36 ?> 37 37 </article><!-- #post-## --> 38 38 39 39 <?php 40 41 42 43 40 // If comments are open or we have at least one comment, load up the comment template. 41 if ( comments_open() || get_comments_number() ) { 42 comments_template(); 43 } 44 44 endwhile; 45 45 ?> 46 46 </div><!-- #content --> -
src/wp-content/themes/twentyfourteen/page-templates/full-width.php
12 12 <div id="main-content" class="main-content"> 13 13 14 14 <?php 15 16 17 18 15 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 16 // Include the featured content template. 17 get_template_part( 'featured-content' ); 18 } 19 19 ?> 20 20 21 21 <div id="primary" class="content-area"> 22 22 <div id="content" class="site-content" role="main"> 23 23 <?php 24 24 // Start the Loop. 25 25 while ( have_posts() ) : the_post(); 26 26 27 28 27 // Include the page content template. 28 get_template_part( 'content', 'page' ); 29 29 30 31 32 33 30 // If comments are open or we have at least one comment, load up the comment template. 31 if ( comments_open() || get_comments_number() ) { 32 comments_template(); 33 } 34 34 endwhile; 35 35 ?> 36 36 </div><!-- #content --> -
src/wp-content/themes/twentyfourteen/page.php
16 16 <div id="main-content" class="main-content"> 17 17 18 18 <?php 19 20 21 22 19 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 20 // Include the featured content template. 21 get_template_part( 'featured-content' ); 22 } 23 23 ?> 24 24 <div id="primary" class="content-area"> 25 25 <div id="content" class="site-content" role="main"> 26 26 27 27 <?php 28 28 // Start the Loop. 29 29 while ( have_posts() ) : the_post(); 30 30 31 32 31 // Include the page content template. 32 get_template_part( 'content', 'page' ); 33 33 34 35 36 37 34 // If comments are open or we have at least one comment, load up the comment template. 35 if ( comments_open() || get_comments_number() ) { 36 comments_template(); 37 } 38 38 endwhile; 39 39 ?> 40 40 -
src/wp-content/themes/twentyfourteen/search.php
20 20 21 21 <?php 22 22 // Start the Loop. 23 23 while ( have_posts() ) : the_post(); 24 24 25 26 27 28 29 30 25 /* 26 * Include the post format-specific template for the content. If you want to 27 * use this in a child theme, then include a file called called content-___.php 28 * (where ___ is the post format) and that will be used instead. 29 */ 30 get_template_part( 'content', get_post_format() ); 31 31 32 32 endwhile; 33 33 // Previous/next post navigation. -
src/wp-content/themes/twentyfourteen/sidebar.php
10 10 <div id="secondary"> 11 11 <?php 12 12 $description = get_bloginfo( 'description', 'display' ); 13 if ( ! empty( $description ) ) :13 if ( ! empty( $description ) ) : 14 14 ?> 15 15 <h2 class="site-description"><?php echo esc_html( $description ); ?></h2> 16 16 <?php endif; ?> 17 17 18 18 <?php if ( has_nav_menu( 'secondary' ) ) : ?> 19 19 <nav role="navigation" class="navigation site-navigation secondary-navigation"> 20 <?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?> 20 <?php wp_nav_menu( array( 21 'theme_location' => 'secondary', 22 ) ); ?> 21 23 </nav> 22 24 <?php endif; ?> 23 25 -
src/wp-content/themes/twentyfourteen/single.php
13 13 <div id="content" class="site-content" role="main"> 14 14 <?php 15 15 // Start the Loop. 16 16 while ( have_posts() ) : the_post(); 17 17 18 19 20 21 22 23 18 /* 19 * Include the post format-specific template for the content. If you want to 20 * use this in a child theme, then include a file called called content-___.php 21 * (where ___ is the post format) and that will be used instead. 22 */ 23 get_template_part( 'content', get_post_format() ); 24 24 25 26 25 // Previous/next post navigation. 26 twentyfourteen_post_nav(); 27 27 28 29 30 31 28 // If comments are open or we have at least one comment, load up the comment template. 29 if ( comments_open() || get_comments_number() ) { 30 comments_template(); 31 } 32 32 endwhile; 33 33 ?> 34 34 </div><!-- #content --> -
src/wp-content/themes/twentyfourteen/tag.php
24 24 <?php 25 25 // Show an optional term description. 26 26 $term_description = term_description(); 27 28 27 if ( ! empty( $term_description ) ) : 28 printf( '<div class="taxonomy-description">%s</div>', $term_description ); 29 29 endif; 30 30 ?> 31 31 </header><!-- .archive-header --> 32 32 33 33 <?php 34 34 // Start the Loop. 35 35 while ( have_posts() ) : the_post(); 36 36 37 38 39 40 41 42 37 /* 38 * Include the post format-specific template for the content. If you want to 39 * use this in a child theme, then include a file called called content-___.php 40 * (where ___ is the post format) and that will be used instead. 41 */ 42 get_template_part( 'content', get_post_format() ); 43 43 44 44 endwhile; 45 45 // Previous/next page navigation. -
src/wp-content/themes/twentyfourteen/taxonomy-post_format.php
26 26 <header class="archive-header"> 27 27 <h1 class="archive-title"> 28 28 <?php 29 30 29 if ( is_tax( 'post_format', 'post-format-aside' ) ) : 30 _e( 'Asides', 'twentyfourteen' ); 31 31 32 32 elseif ( is_tax( 'post_format', 'post-format-image' ) ) : 33 33 _e( 'Images', 'twentyfourteen' ); … … 57 57 58 58 <?php 59 59 // Start the Loop. 60 60 while ( have_posts() ) : the_post(); 61 61 62 63 64 65 66 67 62 /* 63 * Include the post format-specific template for the content. If you want to 64 * use this in a child theme, then include a file called called content-___.php 65 * (where ___ is the post format) and that will be used instead. 66 */ 67 get_template_part( 'content', get_post_format() ); 68 68 69 69 endwhile; 70 70 // Previous/next page navigation. -
src/wp-content/themes/twentyseventeen/archive.php
42 42 endwhile; 43 43 44 44 the_posts_pagination( array( 45 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', 46 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), 45 'prev_text' => twentyseventeen_get_svg( array( 46 'icon' => 'arrow-left', 47 ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', 48 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 49 'icon' => 'arrow-right', 50 ) ), 47 51 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>', 48 52 ) ); 49 53 -
src/wp-content/themes/twentyseventeen/comments.php
57 57 'avatar_size' => 100, 58 58 'style' => 'ol', 59 59 'short_ping' => true, 60 'reply_text' => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ), 60 'reply_text' => twentyseventeen_get_svg( array( 61 'icon' => 'mail-reply', 62 ) ) . __( 'Reply', 'twentyseventeen' ), 61 63 ) ); 62 64 ?> 63 65 </ol> -
src/wp-content/themes/twentyseventeen/inc/custom-header.php
53 53 add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' ); 54 54 55 55 if ( ! function_exists( 'twentyseventeen_header_style' ) ) : 56 /**56 /** 57 57 * Styles the header image and text displayed on the blog. 58 58 * 59 59 * @see twentyseventeen_custom_header_setup(). 60 60 */ 61 function twentyseventeen_header_style() {62 $header_text_color = get_header_textcolor();61 function twentyseventeen_header_style() { 62 $header_text_color = get_header_textcolor(); 63 63 64 // If no custom options for text are set, let's bail.65 // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.66 if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {67 return;68 }64 // If no custom options for text are set, let's bail. 65 // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. 66 if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { 67 return; 68 } 69 69 70 // If we get this far, we have custom styles. Let's do this.71 ?>72 <style id="twentyseventeen-custom-header-styles" type="text/css">73 <?php70 // If we get this far, we have custom styles. Let's do this. 71 ?> 72 <style id="twentyseventeen-custom-header-styles" type="text/css"> 73 <?php 74 74 // Has the text been hidden? 75 75 if ( 'blank' === $header_text_color ) : 76 76 ?> … … 106 106 <?php endif; ?> 107 107 </style> 108 108 <?php 109 }109 } 110 110 endif; // End of twentyseventeen_header_style. 111 111 112 112 /** … … 115 115 * @param array $settings Video settings. 116 116 */ 117 117 function twentyseventeen_video_controls( $settings ) { 118 $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) ); 119 $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) ); 118 $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 119 'icon' => 'play', 120 ) ); 121 $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 122 'icon' => 'pause', 123 ) ); 120 124 return $settings; 121 125 } 122 126 add_filter( 'header_video_settings', 'twentyseventeen_video_controls' ); -
src/wp-content/themes/twentyseventeen/inc/template-tags.php
10 10 */ 11 11 12 12 if ( ! function_exists( 'twentyseventeen_posted_on' ) ) : 13 /**13 /** 14 14 * Prints HTML with meta information for the current post-date/time and author. 15 15 */ 16 function twentyseventeen_posted_on() {16 function twentyseventeen_posted_on() { 17 17 18 // Get the author name; wrap it in a link.19 $byline = sprintf(20 /* translators: %s: post author */21 __( 'by %s', 'twentyseventeen' ),22 '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>'23 );18 // Get the author name; wrap it in a link. 19 $byline = sprintf( 20 /* translators: %s: post author */ 21 __( 'by %s', 'twentyseventeen' ), 22 '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>' 23 ); 24 24 25 // Finally, let's write all of this to the page.26 echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>';27 }25 // Finally, let's write all of this to the page. 26 echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>'; 27 } 28 28 endif; 29 29 30 30 31 31 if ( ! function_exists( 'twentyseventeen_time_link' ) ) : 32 /**32 /** 33 33 * Gets a nicely formatted string for the published date. 34 34 */ 35 function twentyseventeen_time_link() {36 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';37 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {38 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';39 }40 41 $time_string = sprintf( $time_string,42 get_the_date( DATE_W3C ),43 get_the_date(),44 get_the_modified_date( DATE_W3C ),45 get_the_modified_date()46 );47 48 // Wrap the time string in a link, and preface it with 'Posted on'.49 return sprintf(50 /* translators: %s: post date */51 __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ),52 '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'53 );54 }35 function twentyseventeen_time_link() { 36 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; 37 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 38 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 39 } 40 41 $time_string = sprintf( $time_string, 42 get_the_date( DATE_W3C ), 43 get_the_date(), 44 get_the_modified_date( DATE_W3C ), 45 get_the_modified_date() 46 ); 47 48 // Wrap the time string in a link, and preface it with 'Posted on'. 49 return sprintf( 50 /* translators: %s: post date */ 51 __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ), 52 '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>' 53 ); 54 } 55 55 endif; 56 56 57 57 58 58 if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) : 59 /**59 /** 60 60 * Prints HTML with meta information for the categories, tags and comments. 61 61 */ 62 function twentyseventeen_entry_footer() {62 function twentyseventeen_entry_footer() { 63 63 64 /* translators: used between list items, there is a space after the comma */65 $separate_meta = __( ', ', 'twentyseventeen' );64 /* translators: used between list items, there is a space after the comma */ 65 $separate_meta = __( ', ', 'twentyseventeen' ); 66 66 67 // Get Categories for posts.68 $categories_list = get_the_category_list( $separate_meta );67 // Get Categories for posts. 68 $categories_list = get_the_category_list( $separate_meta ); 69 69 70 // Get Tags for posts.71 $tags_list = get_the_tag_list( '', $separate_meta );70 // Get Tags for posts. 71 $tags_list = get_the_tag_list( '', $separate_meta ); 72 72 73 // We don't want to output .entry-footer if it will be empty, so make sure its not.74 if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {73 // We don't want to output .entry-footer if it will be empty, so make sure its not. 74 if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { 75 75 76 echo '<footer class="entry-footer">';76 echo '<footer class="entry-footer">'; 77 77 78 78 if ( 'post' === get_post_type() ) { 79 79 if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) { 80 80 echo '<span class="cat-tags-links">'; 81 81 82 82 // Make sure there's more than one category before displaying. 83 if ( $categories_list && twentyseventeen_categorized_blog() ) { 84 echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; 85 } 86 87 if ( $tags_list ) { 88 echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; 89 } 83 if ( $categories_list && twentyseventeen_categorized_blog() ) { 84 echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 85 'icon' => 'folder-open', 86 ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>'; 87 } 88 89 if ( $tags_list ) { 90 echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 91 'icon' => 'hashtag', 92 ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>'; 93 } 90 94 91 95 echo '</span>'; 92 96 } … … 94 98 95 99 twentyseventeen_edit_link(); 96 100 97 echo '</footer> <!-- .entry-footer -->'; 101 echo '</footer> <!-- .entry-footer -->'; 102 } 98 103 } 99 }100 104 endif; 101 105 102 106 103 107 if ( ! function_exists( 'twentyseventeen_edit_link' ) ) : 104 /**108 /** 105 109 * Returns an accessibility-friendly link to edit a post or page. 106 110 * 107 111 * This also gives us a little context about what exactly we're editing … … 109 113 * of the template hierarchy and their content. Helpful when/if the single-page 110 114 * layout with multiple posts/pages shown gets confusing. 111 115 */ 112 function twentyseventeen_edit_link() {113 edit_post_link(114 sprintf(115 /* translators: %s: Name of current post */116 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),117 get_the_title()118 ),119 '<span class="edit-link">',120 '</span>'121 );122 }116 function twentyseventeen_edit_link() { 117 edit_post_link( 118 sprintf( 119 /* translators: %s: Name of current post */ 120 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), 121 get_the_title() 122 ), 123 '<span class="edit-link">', 124 '</span>' 125 ); 126 } 123 127 endif; 124 128 125 129 /** -
src/wp-content/themes/twentyseventeen/index.php
47 47 endwhile; 48 48 49 49 the_posts_pagination( array( 50 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', 51 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), 50 'prev_text' => twentyseventeen_get_svg( array( 51 'icon' => 'arrow-left', 52 ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', 53 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 54 'icon' => 'arrow-right', 55 ) ), 52 56 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>', 53 57 ) ); 54 58 -
src/wp-content/themes/twentyseventeen/single.php
28 28 endif; 29 29 30 30 the_post_navigation( array( 31 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>', 31 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 32 'icon' => 'arrow-left', 33 ) ) . '</span>%title</span>', 32 34 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>', 33 35 ) ); 34 36 -
src/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php
12 12 <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'twentyseventeen' ); ?>"> 13 13 <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false"> 14 14 <?php 15 echo twentyseventeen_get_svg( array( 'icon' => 'bars' ) ); 16 echo twentyseventeen_get_svg( array( 'icon' => 'close' ) ); 15 echo twentyseventeen_get_svg( array( 16 'icon' => 'bars', 17 ) ); 18 echo twentyseventeen_get_svg( array( 19 'icon' => 'close', 20 ) ); 17 21 _e( 'Menu', 'twentyseventeen' ); 18 22 ?> 19 23 </button> … … 24 28 ) ); ?> 25 29 26 30 <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?> 27 <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a> 31 <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 32 'icon' => 'arrow-right', 33 ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a> 28 34 <?php endif; ?> 29 35 </nav><!-- #site-navigation --> -
src/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php
48 48 49 49 <?php 50 50 // Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int). 51 if ( get_the_ID() === (int) get_option( 'page_for_posts' ) 51 if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : ?> 52 52 53 53 <?php // Show four most recent posts. 54 54 $recent_posts = new WP_Query( array( … … 59 59 ) ); 60 60 ?> 61 61 62 62 <?php if ( $recent_posts->have_posts() ) : ?> 63 63 64 64 <div class="recent-posts"> 65 65 -
src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php
14 14 15 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 16 16 <?php 17 18 19 17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 20 20 ?> 21 21 <header class="entry-header"> 22 22 <?php 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 34 25 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 26 twentyseventeen_posted_on(); 38 27 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 40 } 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 38 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 40 } 41 41 ?> 42 42 </header><!-- .entry-header --> 43 43 … … 46 46 $audio = false; 47 47 48 48 // Only get audio from the content if a playlist isn't present. 49 50 51 49 if ( false === strpos( $content, 'wp-playlist-script' ) ) { 50 $audio = get_media_embedded_in_content( $content, array( 'audio' ) ); 51 } 52 52 53 53 ?> 54 54 -
src/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php
34 34 35 35 // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2. 36 36 the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); 37 38 39 37 } else { 38 the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); 39 } ?> 40 40 </header><!-- .entry-header --> 41 41 42 42 <div class="entry-summary"> -
src/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php
22 22 <?php 23 23 if ( 'post' === get_post_type() ) { 24 24 echo '<div class="entry-meta">'; 25 26 27 28 29 30 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 31 echo '</div><!-- .entry-meta -->'; 32 32 }; 33 33 -
src/wp-content/themes/twentyseventeen/template-parts/post/content-image.php
14 14 15 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 16 16 <?php 17 18 19 17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 20 20 ?> 21 21 <header class="entry-header"> 22 22 <?php 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 34 25 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 26 twentyseventeen_posted_on(); 38 27 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 40 } 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 38 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 40 } 41 41 ?> 42 42 </header><!-- .entry-header --> 43 43 … … 67 67 'link_after' => '</span>', 68 68 ) ); 69 69 70 70 }; 71 71 ?> 72 72 73 73 </div><!-- .entry-content --> -
src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php
14 14 15 15 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 16 16 <?php 17 18 19 17 if ( is_sticky() && is_home() ) { 18 echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) ); 19 } 20 20 ?> 21 21 <header class="entry-header"> 22 22 <?php 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 } 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 23 if ( 'post' === get_post_type() ) { 24 echo '<div class="entry-meta">'; 34 25 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 26 twentyseventeen_posted_on(); 38 27 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 40 30 } 31 echo '</div><!-- .entry-meta -->'; 32 }; 33 34 if ( is_single() ) { 35 the_title( '<h1 class="entry-title">', '</h1>' ); 36 } elseif ( is_front_page() && is_home() ) { 37 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' ); 38 } else { 39 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); 40 } 41 41 ?> 42 42 </header><!-- .entry-header --> 43 43 … … 46 46 $video = false; 47 47 48 48 // Only get video from the content if a playlist isn't present. 49 50 51 49 if ( false === strpos( $content, 'wp-playlist-script' ) ) { 50 $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) ); 51 } 52 52 ?> 53 53 54 54 <?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?> -
src/wp-content/themes/twentyseventeen/template-parts/post/content.php
22 22 <?php 23 23 if ( 'post' === get_post_type() ) { 24 24 echo '<div class="entry-meta">'; 25 26 27 28 29 30 25 if ( is_single() ) { 26 twentyseventeen_posted_on(); 27 } else { 28 echo twentyseventeen_time_link(); 29 twentyseventeen_edit_link(); 30 }; 31 31 echo '</div><!-- .entry-meta -->'; 32 32 }; 33 33 -
src/wp-content/themes/twentysixteen/archive.php
41 41 */ 42 42 get_template_part( 'template-parts/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', 'twentysixteen' ) . ' </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( 'template-parts/content', 'none' ); 57 57 -
src/wp-content/themes/twentysixteen/comments.php
26 26 <h2 class="comments-title"> 27 27 <?php 28 28 $comments_number = get_comments_number(); 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 29 if ( 1 === $comments_number ) { 30 /* translators: %s: post title */ 31 printf( _x( 'One thought on “%s”', 'comments title', 'twentysixteen' ), get_the_title() ); 32 } else { 33 printf( 34 /* translators: 1: number of comments, 2: post title */ 35 _nx( 36 '%1$s thought on “%2$s”', 37 '%1$s thoughts on “%2$s”', 38 $comments_number, 39 'comments title', 40 'twentysixteen' 41 ), 42 number_format_i18n( $comments_number ), 43 get_the_title() 44 ); 45 } 46 46 ?> 47 47 </h2> 48 48 … … 64 64 65 65 <?php 66 66 // If comments are closed and there are comments, let's leave a little note, shall we? 67 67 if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : 68 68 ?> 69 69 <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> 70 70 <?php endif; ?> 71 71 72 72 <?php -
src/wp-content/themes/twentysixteen/footer.php
19 19 wp_nav_menu( array( 20 20 'theme_location' => 'primary', 21 21 'menu_class' => 'primary-menu', 22 22 ) ); 23 23 ?> 24 24 </nav><!-- .main-navigation --> 25 25 <?php endif; ?> -
src/wp-content/themes/twentysixteen/functions.php
33 33 } 34 34 35 35 if ( ! function_exists( 'twentysixteen_setup' ) ) : 36 /**36 /** 37 37 * Sets up theme defaults and registers support for various WordPress features. 38 38 * 39 39 * Note that this function is hooked into the after_setup_theme hook, which … … 44 44 * 45 45 * @since Twenty Sixteen 1.0 46 46 */ 47 function twentysixteen_setup() { 48 /* 49 * Make theme available for translation. 50 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen 51 * If you're building a theme based on Twenty Sixteen, use a find and replace 52 * to change 'twentysixteen' to the name of your theme in all the template files 53 */ 54 load_theme_textdomain( 'twentysixteen' ); 55 56 // Add default posts and comments RSS feed links to head. 57 add_theme_support( 'automatic-feed-links' ); 58 59 /* 60 * Let WordPress manage the document title. 61 * By adding theme support, we declare that this theme does not use a 62 * hard-coded <title> tag in the document head, and expect WordPress to 63 * provide it for us. 64 */ 65 add_theme_support( 'title-tag' ); 66 67 /* 68 * Enable support for custom logo. 69 * 70 * @since Twenty Sixteen 1.2 71 */ 72 add_theme_support( 'custom-logo', array( 73 'height' => 240, 74 'width' => 240, 75 'flex-height' => true, 76 ) ); 77 78 /* 79 * Enable support for Post Thumbnails on posts and pages. 80 * 81 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 82 */ 83 add_theme_support( 'post-thumbnails' ); 84 set_post_thumbnail_size( 1200, 9999 ); 85 86 // This theme uses wp_nav_menu() in two locations. 87 register_nav_menus( array( 88 'primary' => __( 'Primary Menu', 'twentysixteen' ), 89 'social' => __( 'Social Links Menu', 'twentysixteen' ), 90 ) ); 91 92 /* 93 * Switch default core markup for search form, comment form, and comments 94 * to output valid HTML5. 95 */ 96 add_theme_support( 'html5', array( 97 'search-form', 98 'comment-form', 99 'comment-list', 100 'gallery', 101 'caption', 102 ) ); 103 104 /* 105 * Enable support for Post Formats. 106 * 107 * See: https://codex.wordpress.org/Post_Formats 108 */ 109 add_theme_support( 'post-formats', array( 110 'aside', 111 'image', 112 'video', 113 'quote', 114 'link', 115 'gallery', 116 'status', 117 'audio', 118 'chat', 119 ) ); 47 function twentysixteen_setup() { 48 /* 49 * Make theme available for translation. 50 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen 51 * If you're building a theme based on Twenty Sixteen, use a find and replace 52 * to change 'twentysixteen' to the name of your theme in all the template files 53 */ 54 load_theme_textdomain( 'twentysixteen' ); 55 56 // Add default posts and comments RSS feed links to head. 57 add_theme_support( 'automatic-feed-links' ); 58 59 /* 60 * Let WordPress manage the document title. 61 * By adding theme support, we declare that this theme does not use a 62 * hard-coded <title> tag in the document head, and expect WordPress to 63 * provide it for us. 64 */ 65 add_theme_support( 'title-tag' ); 66 67 /* 68 * Enable support for custom logo. 69 * 70 * @since Twenty Sixteen 1.2 71 */ 72 add_theme_support( 'custom-logo', array( 73 'height' => 240, 74 'width' => 240, 75 'flex-height' => true, 76 ) ); 77 78 /* 79 * Enable support for Post Thumbnails on posts and pages. 80 * 81 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 82 */ 83 add_theme_support( 'post-thumbnails' ); 84 set_post_thumbnail_size( 1200, 9999 ); 85 86 // This theme uses wp_nav_menu() in two locations. 87 register_nav_menus( array( 88 'primary' => __( 'Primary Menu', 'twentysixteen' ), 89 'social' => __( 'Social Links Menu', 'twentysixteen' ), 90 ) ); 91 92 /* 93 * Switch default core markup for search form, comment form, and comments 94 * to output valid HTML5. 95 */ 96 add_theme_support( 'html5', array( 97 'search-form', 98 'comment-form', 99 'comment-list', 100 'gallery', 101 'caption', 102 ) ); 103 104 /* 105 * Enable support for Post Formats. 106 * 107 * See: https://codex.wordpress.org/Post_Formats 108 */ 109 add_theme_support( 'post-formats', array( 110 'aside', 111 'image', 112 'video', 113 'quote', 114 'link', 115 'gallery', 116 'status', 117 'audio', 118 'chat', 119 ) ); 120 121 /* 122 * This theme styles the visual editor to resemble the theme style, 123 * specifically font, colors, icons, and column width. 124 */ 125 add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); 120 126 121 /* 122 * This theme styles the visual editor to resemble the theme style, 123 * specifically font, colors, icons, and column width. 124 */ 125 add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); 126 127 // Indicate widget sidebars can use selective refresh in the Customizer. 128 add_theme_support( 'customize-selective-refresh-widgets' ); 129 } 127 // Indicate widget sidebars can use selective refresh in the Customizer. 128 add_theme_support( 'customize-selective-refresh-widgets' ); 129 } 130 130 endif; // twentysixteen_setup 131 131 add_action( 'after_setup_theme', 'twentysixteen_setup' ); 132 132 … … 185 185 add_action( 'widgets_init', 'twentysixteen_widgets_init' ); 186 186 187 187 if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : 188 /**188 /** 189 189 * Register Google fonts for Twenty Sixteen. 190 190 * 191 191 * Create your own twentysixteen_fonts_url() function to override in a child theme. … … 194 194 * 195 195 * @return string Google fonts URL for the theme. 196 196 */ 197 function twentysixteen_fonts_url() { 198 $fonts_url = ''; 199 $fonts = array(); 200 $subsets = 'latin,latin-ext'; 201 202 /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ 203 if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { 204 $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; 205 } 206 207 /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ 208 if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { 209 $fonts[] = 'Montserrat:400,700'; 210 } 211 212 /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ 213 if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { 214 $fonts[] = 'Inconsolata:400'; 215 } 197 function twentysixteen_fonts_url() { 198 $fonts_url = ''; 199 $fonts = array(); 200 $subsets = 'latin,latin-ext'; 201 202 /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ 203 if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { 204 $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; 205 } 206 207 /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ 208 if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { 209 $fonts[] = 'Montserrat:400,700'; 210 } 211 212 /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ 213 if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { 214 $fonts[] = 'Inconsolata:400'; 215 } 216 217 if ( $fonts ) { 218 $fonts_url = add_query_arg( array( 219 'family' => urlencode( implode( '|', $fonts ) ), 220 'subset' => urlencode( $subsets ), 221 ), 'https://fonts.googleapis.com/css' ); 222 } 216 223 217 if ( $fonts ) { 218 $fonts_url = add_query_arg( array( 219 'family' => urlencode( implode( '|', $fonts ) ), 220 'subset' => urlencode( $subsets ), 221 ), 'https://fonts.googleapis.com/css' ); 224 return $fonts_url; 222 225 } 223 224 return $fonts_url;225 }226 226 endif; 227 227 228 228 /** … … 333 333 $color = trim( $color, '#' ); 334 334 335 335 if ( strlen( $color ) === 3 ) { 336 $r = hexdec( substr( $color, 0, 1 ) .substr( $color, 0, 1 ) );337 $g = hexdec( substr( $color, 1, 1 ) .substr( $color, 1, 1 ) );338 $b = hexdec( substr( $color, 2, 1 ) .substr( $color, 2, 1 ) );339 } else 336 $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) ); 337 $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) ); 338 $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) ); 339 } elseif ( strlen( $color ) === 6 ) { 340 340 $r = hexdec( substr( $color, 0, 2 ) ); 341 341 $g = hexdec( substr( $color, 2, 2 ) ); 342 342 $b = hexdec( substr( $color, 4, 2 ) ); … … 344 344 return array(); 345 345 } 346 346 347 return array( 'red' => $r, 'green' => $g, 'blue' => $b ); 347 return array( 348 'red' => $r, 349 'green' => $g, 350 'blue' => $b, 351 ); 348 352 } 349 353 350 354 /** -
src/wp-content/themes/twentysixteen/header.php
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 </div><!-- .site-branding --> … … 53 53 wp_nav_menu( array( 54 54 'theme_location' => 'primary', 55 55 'menu_class' => 'primary-menu', 56 56 ) ); 57 57 ?> 58 58 </nav><!-- .main-navigation --> 59 59 <?php endif; ?> -
src/wp-content/themes/twentysixteen/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 37 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', 'twentysixteen' ) ); ?></div> 25 <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></div> 26 </div><!-- .nav-links --> 27 </nav><!-- .image-navigation --> 28 29 <header class="entry-header"> 30 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> 31 </header><!-- .entry-header --> 32 33 <div class="entry-content"> 34 35 <div class="entry-attachment"> 36 <?php 37 /** 38 38 * Filter the default twentysixteen image attachment size. 39 39 * 40 40 * @since Twenty Sixteen 1.0 41 41 * 42 42 * @param string $image_size Image size. Default 'large'. 43 43 */ 44 44 $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' ); 45 45 46 47 46 echo wp_get_attachment_image( get_the_ID(), $image_size ); 47 ?> 48 48 49 49 <?php twentysixteen_excerpt( 'entry-caption' ); ?> 50 50 51 51 </div><!-- .entry-attachment --> 52 52 53 53 <?php 54 55 56 57 58 59 60 61 62 63 54 the_content(); 55 wp_link_pages( array( 56 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>', 57 'after' => '</div>', 58 'link_before' => '<span>', 59 'link_after' => '</span>', 60 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%', 61 'separator' => '<span class="screen-reader-text">, </span>', 62 ) ); 63 ?> 64 64 </div><!-- .entry-content --> 65 65 66 66 <footer class="entry-footer"> 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 67 <?php twentysixteen_entry_meta(); ?> 68 <?php 69 // Retrieve attachment metadata. 70 $metadata = wp_get_attachment_metadata(); 71 if ( $metadata ) { 72 printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>', 73 esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), 74 esc_url( wp_get_attachment_url() ), 75 absint( $metadata['width'] ), 76 absint( $metadata['height'] ) 77 ); 78 } 79 ?> 80 <?php 81 edit_post_link( 82 sprintf( 83 /* translators: %s: Name of current post */ 84 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), 85 get_the_title() 86 ), 87 '<span class="edit-link">', 88 '</span>' 89 ); 90 ?> 91 91 </footer><!-- .entry-footer --> 92 92 </article><!-- #post-## --> 93 93 94 94 <?php 95 96 97 98 99 100 101 102 103 95 // If comments are open or we have at least one comment, load up the comment template. 96 if ( comments_open() || get_comments_number() ) { 97 comments_template(); 98 } 99 100 // Parent post navigation. 101 the_post_navigation( array( 102 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ), 103 ) ); 104 104 // End the loop. 105 105 endwhile; 106 106 ?> -
src/wp-content/themes/twentysixteen/inc/customizer.php
61 61 add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' ); 62 62 63 63 if ( ! function_exists( 'twentysixteen_header_style' ) ) : 64 /**64 /** 65 65 * Styles the header text displayed on the site. 66 66 * 67 67 * Create your own twentysixteen_header_style() function to override in a child theme. … … 70 70 * 71 71 * @see twentysixteen_custom_header_and_background(). 72 72 */ 73 function twentysixteen_header_style() {74 // If the header text option is untouched, let's bail.75 if ( display_header_text() ) {76 return;77 }73 function twentysixteen_header_style() { 74 // If the header text option is untouched, let's bail. 75 if ( display_header_text() ) { 76 return; 77 } 78 78 79 // If the header text has been hidden.80 ?>81 <style type="text/css" id="twentysixteen-header-css">79 // If the header text has been hidden. 80 ?> 81 <style type="text/css" id="twentysixteen-header-css"> 82 82 .site-branding { 83 83 margin: 0 auto 0 0; 84 84 } … … 88 88 clip: rect(1px, 1px, 1px, 1px); 89 89 position: absolute; 90 90 } 91 </style>92 <?php93 }91 </style> 92 <?php 93 } 94 94 endif; // twentysixteen_header_style 95 95 96 96 /** … … 303 303 } 304 304 305 305 if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) : 306 /**306 /** 307 307 * Retrieves the current Twenty Sixteen color scheme. 308 308 * 309 309 * Create your own twentysixteen_get_color_scheme() function to override in a child theme. … … 312 312 * 313 313 * @return array An associative array of either the current or default color scheme HEX values. 314 314 */ 315 function twentysixteen_get_color_scheme() {316 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );317 $color_schemes = twentysixteen_get_color_schemes();315 function twentysixteen_get_color_scheme() { 316 $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); 317 $color_schemes = twentysixteen_get_color_schemes(); 318 318 319 if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {320 return $color_schemes[ $color_scheme_option ]['colors'];321 }319 if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { 320 return $color_schemes[ $color_scheme_option ]['colors']; 321 } 322 322 323 return $color_schemes['default']['colors'];324 }323 return $color_schemes['default']['colors']; 324 } 325 325 endif; // twentysixteen_get_color_scheme 326 326 327 327 if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) : 328 /**328 /** 329 329 * Retrieves an array of color scheme choices registered for Twenty Sixteen. 330 330 * 331 331 * Create your own twentysixteen_get_color_scheme_choices() function to override … … 335 335 * 336 336 * @return array Array of color schemes. 337 337 */ 338 function twentysixteen_get_color_scheme_choices() {339 $color_schemes = twentysixteen_get_color_schemes();340 $color_scheme_control_options = array();338 function twentysixteen_get_color_scheme_choices() { 339 $color_schemes = twentysixteen_get_color_schemes(); 340 $color_scheme_control_options = array(); 341 341 342 foreach ( $color_schemes as $color_scheme => $value ) {343 $color_scheme_control_options[ $color_scheme ] = $value['label'];344 }342 foreach ( $color_schemes as $color_scheme => $value ) { 343 $color_scheme_control_options[ $color_scheme ] = $value['label']; 344 } 345 345 346 return $color_scheme_control_options;347 }346 return $color_scheme_control_options; 347 } 348 348 endif; // twentysixteen_get_color_scheme_choices 349 349 350 350 351 351 if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) : 352 /**352 /** 353 353 * Handles sanitization for Twenty Sixteen color schemes. 354 354 * 355 355 * Create your own twentysixteen_sanitize_color_scheme() function to override … … 360 360 * @param string $value Color scheme name value. 361 361 * @return string Color scheme name. 362 362 */ 363 function twentysixteen_sanitize_color_scheme( $value ) {364 $color_schemes = twentysixteen_get_color_scheme_choices();363 function twentysixteen_sanitize_color_scheme( $value ) { 364 $color_schemes = twentysixteen_get_color_scheme_choices(); 365 365 366 if ( ! array_key_exists( $value, $color_schemes ) ) {367 return 'default';368 }366 if ( ! array_key_exists( $value, $color_schemes ) ) { 367 return 'default'; 368 } 369 369 370 return $value;371 }370 return $value; 371 } 372 372 endif; // twentysixteen_sanitize_color_scheme 373 373 374 374 /** -
src/wp-content/themes/twentysixteen/inc/template-tags.php
10 10 */ 11 11 12 12 if ( ! function_exists( 'twentysixteen_entry_meta' ) ) : 13 /**13 /** 14 14 * Prints HTML with meta information for the categories, tags. 15 15 * 16 16 * Create your own twentysixteen_entry_meta() function to override in a child theme. 17 17 * 18 18 * @since Twenty Sixteen 1.0 19 19 */ 20 function twentysixteen_entry_meta() { 21 if ( 'post' === get_post_type() ) { 22 $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); 23 printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', 24 get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), 25 _x( 'Author', 'Used before post author name.', 'twentysixteen' ), 26 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 27 get_the_author() 28 ); 29 } 30 31 if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { 32 twentysixteen_entry_date(); 33 } 34 35 $format = get_post_format(); 36 if ( current_theme_supports( 'post-formats', $format ) ) { 37 printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', 38 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), 39 esc_url( get_post_format_link( $format ) ), 40 get_post_format_string( $format ) 41 ); 42 } 43 44 if ( 'post' === get_post_type() ) { 45 twentysixteen_entry_taxonomies(); 46 } 47 48 if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 49 echo '<span class="comments-link">'; 50 comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); 51 echo '</span>'; 20 function twentysixteen_entry_meta() { 21 if ( 'post' === get_post_type() ) { 22 $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); 23 printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', 24 get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), 25 _x( 'Author', 'Used before post author name.', 'twentysixteen' ), 26 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 27 get_the_author() 28 ); 29 } 30 31 if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { 32 twentysixteen_entry_date(); 33 } 34 35 $format = get_post_format(); 36 if ( current_theme_supports( 'post-formats', $format ) ) { 37 printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', 38 sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), 39 esc_url( get_post_format_link( $format ) ), 40 get_post_format_string( $format ) 41 ); 42 } 43 44 if ( 'post' === get_post_type() ) { 45 twentysixteen_entry_taxonomies(); 46 } 47 48 if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 49 echo '<span class="comments-link">'; 50 comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) ); 51 echo '</span>'; 52 } 52 53 } 53 }54 54 endif; 55 55 56 56 if ( ! function_exists( 'twentysixteen_entry_date' ) ) : 57 /**57 /** 58 58 * Prints HTML with date information for current post. 59 59 * 60 60 * Create your own twentysixteen_entry_date() function to override in a child theme. 61 61 * 62 62 * @since Twenty Sixteen 1.0 63 63 */ 64 function twentysixteen_entry_date() {65 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';64 function twentysixteen_entry_date() { 65 $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; 66 66 67 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 68 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 69 } 67 if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 68 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; 69 } 70 71 $time_string = sprintf( $time_string, 72 esc_attr( get_the_date( 'c' ) ), 73 get_the_date(), 74 esc_attr( get_the_modified_date( 'c' ) ), 75 get_the_modified_date() 76 ); 70 77 71 $time_string = sprintf( $time_string, 72 esc_attr( get_the_date( 'c' ) ), 73 get_the_date(), 74 esc_attr( get_the_modified_date( 'c' ) ), 75 get_the_modified_date() 76 ); 77 78 printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', 79 _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), 80 esc_url( get_permalink() ), 81 $time_string 82 ); 83 } 78 printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', 79 _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), 80 esc_url( get_permalink() ), 81 $time_string 82 ); 83 } 84 84 endif; 85 85 86 86 if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : 87 /**87 /** 88 88 * Prints HTML with category and tags for current post. 89 89 * 90 90 * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. 91 91 * 92 92 * @since Twenty Sixteen 1.0 93 93 */ 94 function twentysixteen_entry_taxonomies() { 95 $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); 96 if ( $categories_list && twentysixteen_categorized_blog() ) { 97 printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 98 _x( 'Categories', 'Used before category names.', 'twentysixteen' ), 99 $categories_list 100 ); 94 function twentysixteen_entry_taxonomies() { 95 $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); 96 if ( $categories_list && twentysixteen_categorized_blog() ) { 97 printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 98 _x( 'Categories', 'Used before category names.', 'twentysixteen' ), 99 $categories_list 100 ); 101 } 102 103 $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); 104 if ( $tags_list ) { 105 printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', 106 _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), 107 $tags_list 108 ); 109 } 101 110 } 102 103 $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );104 if ( $tags_list ) {105 printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',106 _x( 'Tags', 'Used before tag names.', 'twentysixteen' ),107 $tags_list108 );109 }110 }111 111 endif; 112 112 113 113 if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : 114 /**114 /** 115 115 * Displays an optional post thumbnail. 116 116 * 117 117 * Wraps the post thumbnail in an anchor element on index views, or a div … … 121 121 * 122 122 * @since Twenty Sixteen 1.0 123 123 */ 124 function twentysixteen_post_thumbnail() {125 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {126 return;127 }124 function twentysixteen_post_thumbnail() { 125 if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { 126 return; 127 } 128 128 129 if ( is_singular() ) :130 ?>129 if ( is_singular() ) : 130 ?> 131 131 132 <div class="post-thumbnail">132 <div class="post-thumbnail"> 133 133 <?php the_post_thumbnail(); ?> 134 134 </div><!-- .post-thumbnail --> 135 135 136 136 <?php else : ?> 137 137 138 138 <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true"> 139 <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?> 139 <?php the_post_thumbnail( 'post-thumbnail', array( 140 'alt' => the_title_attribute( 'echo=0' ), 141 ) ); ?> 140 142 </a> 141 143 142 144 <?php endif; // End is_singular() 143 }145 } 144 146 endif; 145 147 146 148 if ( ! function_exists( 'twentysixteen_excerpt' ) ) : … … 167 169 endif; 168 170 169 171 if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) : 170 /**172 /** 171 173 * Replaces "[...]" (appended to automatically generated excerpts) with ... and 172 174 * a 'Continue reading' link. 173 175 * … … 177 179 * 178 180 * @return string 'Continue reading' link prepended with an ellipsis. 179 181 */ 180 function twentysixteen_excerpt_more() {181 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',182 esc_url( get_permalink( get_the_ID() ) ),183 /* translators: %s: Name of current post */184 sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )185 );186 return ' … ' . $link;187 }188 add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' );182 function twentysixteen_excerpt_more() { 183 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', 184 esc_url( get_permalink( get_the_ID() ) ), 185 /* translators: %s: Name of current post */ 186 sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) ) 187 ); 188 return ' … ' . $link; 189 } 190 add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); 189 191 endif; 190 192 191 193 if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : 192 /**194 /** 193 195 * Determines whether blog/site has more than one category. 194 196 * 195 197 * Create your own twentysixteen_categorized_blog() function to override in a child theme. … … 198 200 * 199 201 * @return bool True if there is more than one category, false otherwise. 200 202 */ 201 function twentysixteen_categorized_blog() { 202 if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { 203 // Create an array of all the categories that are attached to posts. 204 $all_the_cool_cats = get_categories( array( 205 'fields' => 'ids', 206 // We only need to know if there is more than one category. 207 'number' => 2, 208 ) ); 209 210 // Count the number of categories that are attached to the posts. 211 $all_the_cool_cats = count( $all_the_cool_cats ); 212 213 set_transient( 'twentysixteen_categories', $all_the_cool_cats ); 214 } 215 216 if ( $all_the_cool_cats > 1 ) { 217 // This blog has more than 1 category so twentysixteen_categorized_blog should return true. 218 return true; 219 } else { 220 // This blog has only 1 category so twentysixteen_categorized_blog should return false. 221 return false; 203 function twentysixteen_categorized_blog() { 204 if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { 205 // Create an array of all the categories that are attached to posts. 206 $all_the_cool_cats = get_categories( array( 207 'fields' => 'ids', 208 // We only need to know if there is more than one category. 209 'number' => 2, 210 ) ); 211 212 // Count the number of categories that are attached to the posts. 213 $all_the_cool_cats = count( $all_the_cool_cats ); 214 215 set_transient( 'twentysixteen_categories', $all_the_cool_cats ); 216 } 217 218 if ( $all_the_cool_cats > 1 ) { 219 // This blog has more than 1 category so twentysixteen_categorized_blog should return true. 220 return true; 221 } else { 222 // This blog has only 1 category so twentysixteen_categorized_blog should return false. 223 return false; 224 } 222 225 } 223 }224 226 endif; 225 227 226 228 /** … … 239 241 add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); 240 242 241 243 if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : 242 /**244 /** 243 245 * Displays the optional custom logo. 244 246 * 245 247 * Does nothing if the custom logo is not available. 246 248 * 247 249 * @since Twenty Sixteen 1.2 248 250 */ 249 function twentysixteen_the_custom_logo() { 250 if ( function_exists( 'the_custom_logo' ) ) { 251 the_custom_logo(); 251 function twentysixteen_the_custom_logo() { 252 if ( function_exists( 'the_custom_logo' ) ) { 253 the_custom_logo(); 254 } 252 255 } 253 }254 256 endif; -
src/wp-content/themes/twentysixteen/index.php
38 38 */ 39 39 get_template_part( 'template-parts/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', 'twentysixteen' ) . ' </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( 'template-parts/content', 'none' ); 54 54 -
src/wp-content/themes/twentysixteen/search.php
29 29 */ 30 30 get_template_part( 'template-parts/content', 'search' ); 31 31 32 // End the loop.32 // End the loop. 33 33 endwhile; 34 34 35 35 // Previous/next page navigation. … … 39 39 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', 40 40 ) ); 41 41 42 // If no content, include the "No posts found" template.42 // If no content, include the "No posts found" template. 43 43 else : 44 44 get_template_part( 'template-parts/content', 'none' ); 45 45 -
src/wp-content/themes/twentysixteen/sidebar.php
8 8 */ 9 9 ?> 10 10 11 <?php if ( is_active_sidebar( 'sidebar-1' ) 11 <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?> 12 12 <aside id="secondary" class="sidebar widget-area" role="complementary"> 13 13 <?php dynamic_sidebar( 'sidebar-1' ); ?> 14 14 </aside><!-- .sidebar .widget-area --> -
src/wp-content/themes/twentyten/404.php
27 27 document.getElementById('s') && document.getElementById('s').focus(); 28 28 </script> 29 29 30 <?php get_footer(); ?> 31 No newline at end of file 30 <?php get_footer(); ?> -
src/wp-content/themes/twentyten/archive.php
25 25 * We reset this later so we can run the loop 26 26 * properly with a call to rewind_posts(). 27 27 */ 28 if ( have_posts() ) 29 the_post(); 28 if ( have_posts() ) { 29 the_post(); 30 } 30 31 ?> 31 32 32 33 <h1 class="page-title"> -
src/wp-content/themes/twentyten/author.php
21 21 * We reset this later so we can run the loop 22 22 * properly with a call to rewind_posts(). 23 23 */ 24 if ( have_posts() ) 25 the_post(); 24 if ( have_posts() ) { 25 the_post(); 26 } 26 27 ?> 27 28 28 29 <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1> -
src/wp-content/themes/twentyten/category.php
17 17 ?></h1> 18 18 <?php 19 19 $category_description = category_description(); 20 if ( ! empty( $category_description ) ) 21 echo '<div class="archive-meta">' . $category_description . '</div>'; 20 if ( ! empty( $category_description ) ) { 21 echo '<div class="archive-meta">' . $category_description . '</div>'; 22 } 22 23 23 24 /* 24 25 * Run the loop for the category page to output the posts. -
src/wp-content/themes/twentyten/functions.php
44 44 * Used to set the width of images and content. Should be equal to the width the theme 45 45 * is designed for, generally via the style.css stylesheet. 46 46 */ 47 if ( ! isset( $content_width ) ) 47 if ( ! isset( $content_width ) ) { 48 48 $content_width = 640; 49 } 49 50 50 51 /* Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */ 51 52 add_action( 'after_setup_theme', 'twentyten_setup' ); 52 53 53 if ( ! function_exists( 'twentyten_setup' ) ) :54 /**54 if ( ! function_exists( 'twentyten_setup' ) ) : 55 /** 55 56 * Set up theme defaults and registers support for various WordPress features. 56 57 * 57 58 * Note that this function is hooked into the after_setup_theme hook, which runs … … 70 71 * 71 72 * @since Twenty Ten 1.0 72 73 */ 73 function twentyten_setup() { 74 75 // This theme styles the visual editor with editor-style.css to match the theme style. 76 add_editor_style(); 74 function twentyten_setup() { 77 75 78 // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.79 add_theme_support( 'post-formats', array( 'aside', 'gallery' ));76 // This theme styles the visual editor with editor-style.css to match the theme style. 77 add_editor_style(); 80 78 81 // This theme uses post thumbnails82 add_theme_support( 'post-thumbnails');79 // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories. 80 add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); 83 81 84 // Add default posts and comments RSS feed links to head85 add_theme_support( 'automatic-feed-links' );82 // This theme uses post thumbnails 83 add_theme_support( 'post-thumbnails' ); 86 84 87 /* 88 * Make theme available for translation. 89 * Translations can be filed in the /languages/ directory 90 */ 91 load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' ); 92 93 // This theme uses wp_nav_menu() in one location. 94 register_nav_menus( array( 95 'primary' => __( 'Primary Navigation', 'twentyten' ), 96 ) ); 85 // Add default posts and comments RSS feed links to head 86 add_theme_support( 'automatic-feed-links' ); 97 87 98 // This theme allows users to set a custom background.99 add_theme_support( 'custom-background', array(100 // Let WordPress know what our default background color is.101 'default-color' => 'f1f1f1',102 ) );103 104 // The custom header business starts here.105 106 $custom_header_support = array(107 88 /* 108 * The default image to use.109 * T he %s is a placeholder for the theme template directory URI.89 * Make theme available for translation. 90 * Translations can be filed in the /languages/ directory 110 91 */ 111 'default-image' => '%s/images/headers/path.jpg', 112 // The height and width of our custom header. 113 /** 92 load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' ); 93 94 // This theme uses wp_nav_menu() in one location. 95 register_nav_menus( array( 96 'primary' => __( 'Primary Navigation', 'twentyten' ), 97 ) ); 98 99 // This theme allows users to set a custom background. 100 add_theme_support( 'custom-background', array( 101 // Let WordPress know what our default background color is. 102 'default-color' => 'f1f1f1', 103 ) ); 104 105 // The custom header business starts here. 106 107 $custom_header_support = array( 108 /* 109 * The default image to use. 110 * The %s is a placeholder for the theme template directory URI. 111 */ 112 'default-image' => '%s/images/headers/path.jpg', 113 // The height and width of our custom header. 114 /** 114 115 * Filter the Twenty Ten default header image width. 115 116 * 116 117 * @since Twenty Ten 1.0 117 118 * 118 119 * @param int The default header image width in pixels. Default 940. 119 120 */ 120 'width' => apply_filters( 'twentyten_header_image_width', 940 ),121 /**121 'width' => apply_filters( 'twentyten_header_image_width', 940 ), 122 /** 122 123 * Filter the Twenty Ten defaul header image height. 123 124 * 124 125 * @since Twenty Ten 1.0 125 126 * 126 127 * @param int The default header image height in pixels. Default 198. 127 128 */ 128 'height' => apply_filters( 'twentyten_header_image_height', 198 ),129 // Support flexible heights.130 'flex-height' => true,131 // Don't support text inside the header image.132 'header-text' => false,133 // Callback for styling the header preview in the admin.134 'admin-head-callback' => 'twentyten_admin_header_style',135 );136 137 add_theme_support( 'custom-header', $custom_header_support );138 139 if ( ! function_exists( 'get_custom_header' ) ) {140 // This is all for compatibility with versions of WordPress prior to 3.4.141 define( 'HEADER_TEXTCOLOR', '' );142 define( 'NO_HEADER_TEXT', true );143 define( 'HEADER_IMAGE', $custom_header_support['default-image'] );144 define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );145 define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );146 add_custom_image_header( '', $custom_header_support['admin-head-callback'] );147 add_custom_background();148 }149 150 /*151 * We'll be using post thumbnails for custom header images on posts and pages.152 * We want them to be 940 pixels wide by 198 pixels tall.153 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.154 */155 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );156 157 // ... and thus ends the custom header business.158 159 // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.160 register_default_headers( array(161 'berries' => array(162 'url' => '%s/images/headers/berries.jpg',163 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg',164 /* translators: header image description */165 'description' => __( 'Berries', 'twentyten' )166 ),167 'cherryblossom' => array(168 'url' => '%s/images/headers/cherryblossoms.jpg',169 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg',170 /* translators: header image description */171 'description' => __( 'Cherry Blossoms', 'twentyten' )172 ),173 'concave' => array(174 'url' => '%s/images/headers/concave.jpg',175 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg',176 /* translators: header image description */177 'description' => __( 'Concave', 'twentyten' )178 ),179 'fern' => array(180 'url' => '%s/images/headers/fern.jpg',181 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg',182 /* translators: header image description */183 'description' => __( 'Fern', 'twentyten' )184 ),185 'forestfloor' => array(186 'url' => '%s/images/headers/forestfloor.jpg',187 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg',188 /* translators: header image description */189 'description' => __( 'Forest Floor', 'twentyten' )190 ),191 'inkwell' => array(192 'url' => '%s/images/headers/inkwell.jpg',193 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg',194 /* translators: header image description */195 'description' => __( 'Inkwell', 'twentyten' )196 ),197 'path' => array(198 'url' => '%s/images/headers/path.jpg',199 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg',200 /* translators: header image description */201 'description' => __( 'Path', 'twentyten' )202 ),203 'sunset' => array(204 'url' => '%s/images/headers/sunset.jpg',205 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',206 /* translators: header image description */207 'description' => __( 'Sunset', 'twentyten' )208 )209 ) );210 }129 'height' => apply_filters( 'twentyten_header_image_height', 198 ), 130 // Support flexible heights. 131 'flex-height' => true, 132 // Don't support text inside the header image. 133 'header-text' => false, 134 // Callback for styling the header preview in the admin. 135 'admin-head-callback' => 'twentyten_admin_header_style', 136 ); 137 138 add_theme_support( 'custom-header', $custom_header_support ); 139 140 if ( ! function_exists( 'get_custom_header' ) ) { 141 // This is all for compatibility with versions of WordPress prior to 3.4. 142 define( 'HEADER_TEXTCOLOR', '' ); 143 define( 'NO_HEADER_TEXT', true ); 144 define( 'HEADER_IMAGE', $custom_header_support['default-image'] ); 145 define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] ); 146 define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] ); 147 add_custom_image_header( '', $custom_header_support['admin-head-callback'] ); 148 add_custom_background(); 149 } 150 151 /* 152 * We'll be using post thumbnails for custom header images on posts and pages. 153 * We want them to be 940 pixels wide by 198 pixels tall. 154 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 155 */ 156 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); 157 158 // ... and thus ends the custom header business. 159 160 // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. 161 register_default_headers( array( 162 'berries' => array( 163 'url' => '%s/images/headers/berries.jpg', 164 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 165 /* translators: header image description */ 166 'description' => __( 'Berries', 'twentyten' ), 167 ), 168 'cherryblossom' => array( 169 'url' => '%s/images/headers/cherryblossoms.jpg', 170 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 171 /* translators: header image description */ 172 'description' => __( 'Cherry Blossoms', 'twentyten' ), 173 ), 174 'concave' => array( 175 'url' => '%s/images/headers/concave.jpg', 176 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 177 /* translators: header image description */ 178 'description' => __( 'Concave', 'twentyten' ), 179 ), 180 'fern' => array( 181 'url' => '%s/images/headers/fern.jpg', 182 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 183 /* translators: header image description */ 184 'description' => __( 'Fern', 'twentyten' ), 185 ), 186 'forestfloor' => array( 187 'url' => '%s/images/headers/forestfloor.jpg', 188 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 189 /* translators: header image description */ 190 'description' => __( 'Forest Floor', 'twentyten' ), 191 ), 192 'inkwell' => array( 193 'url' => '%s/images/headers/inkwell.jpg', 194 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 195 /* translators: header image description */ 196 'description' => __( 'Inkwell', 'twentyten' ), 197 ), 198 'path' => array( 199 'url' => '%s/images/headers/path.jpg', 200 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 201 /* translators: header image description */ 202 'description' => __( 'Path', 'twentyten' ), 203 ), 204 'sunset' => array( 205 'url' => '%s/images/headers/sunset.jpg', 206 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 207 /* translators: header image description */ 208 'description' => __( 'Sunset', 'twentyten' ), 209 ), 210 ) ); 211 } 211 212 endif; 212 213 213 214 if ( ! function_exists( 'twentyten_admin_header_style' ) ) : 214 /**215 /** 215 216 * Style the header image displayed on the Appearance > Header admin panel. 216 217 * 217 218 * Referenced via add_custom_image_header() in twentyten_setup(). 218 219 * 219 220 * @since Twenty Ten 1.0 220 221 */ 221 function twentyten_admin_header_style() {222 ?>223 <style type="text/css" id="twentyten-admin-header-css">224 /* Shows the same border as on front end */225 #headimg {226 border-bottom: 1px solid #000;227 border-top: 4px solid #000;228 }229 /* If header-text was supported, you would style the text with these selectors:230 #headimg #name { }231 #headimg #desc { }232 */233 </style>234 <?php235 }222 function twentyten_admin_header_style() { 223 ?> 224 <style type="text/css" id="twentyten-admin-header-css"> 225 /* Shows the same border as on front end */ 226 #headimg { 227 border-bottom: 1px solid #000; 228 border-top: 4px solid #000; 229 } 230 /* If header-text was supported, you would style the text with these selectors: 231 #headimg #name { } 232 #headimg #desc { } 233 */ 234 </style> 235 <?php 236 } 236 237 endif; 237 238 238 239 /** … … 246 247 * @param array $args An optional array of arguments. @see wp_page_menu() 247 248 */ 248 249 function twentyten_page_menu_args( $args ) { 249 if ( ! isset( $args['show_home'] ) ) 250 if ( ! isset( $args['show_home'] ) ) { 250 251 $args['show_home'] = true; 252 } 251 253 return $args; 252 254 } 253 255 add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' ); … … 269 271 add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); 270 272 271 273 if ( ! function_exists( 'twentyten_continue_reading_link' ) ) : 272 /**274 /** 273 275 * Return a "Continue Reading" link for excerpts. 274 276 * 275 277 * @since Twenty Ten 1.0 276 278 * 277 279 * @return string "Continue Reading" link. 278 280 */ 279 function twentyten_continue_reading_link() {280 return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>';281 }281 function twentyten_continue_reading_link() { 282 return ' <a href="' . get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>'; 283 } 282 284 endif; 283 285 284 286 /** … … 346 348 return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); 347 349 } 348 350 // Backwards compatibility with WordPress 3.0. 349 if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) 351 if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) { 350 352 add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); 353 } 351 354 352 355 if ( ! function_exists( 'twentyten_comment' ) ) : 353 /**356 /** 354 357 * Template for comments and pingbacks. 355 358 * 356 359 * To override this walker in a child theme without modifying the comments template … … 364 367 * @param array $args An array of arguments. @see get_comment_reply_link() 365 368 * @param int $depth The depth of the comment. 366 369 */ 367 function twentyten_comment( $comment, $args, $depth ) {368 $GLOBALS['comment'] = $comment;369 switch ( $comment->comment_type ) :370 case '' :371 ?>372 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">370 function twentyten_comment( $comment, $args, $depth ) { 371 $GLOBALS['comment'] = $comment; 372 switch ( $comment->comment_type ) : 373 case '' : 374 ?> 375 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> 373 376 <div id="comment-<?php comment_ID(); ?>"> 374 377 <div class="comment-author vcard"> 375 378 <?php echo get_avatar( $comment, 40 ); ?> … … 385 388 /* translators: 1: date, 2: time */ 386 389 printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); 387 390 ?> 388 </div><!-- .comment-meta .commentmetadata -->391 </div><!-- .comment-meta .commentmetadata --> 389 392 390 <div class="comment-body"><?php comment_text(); ?></div>393 <div class="comment-body"><?php comment_text(); ?></div> 391 394 392 <div class="reply"> 393 <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 394 </div><!-- .reply --> 395 </div><!-- #comment-## --> 395 <div class="reply"> 396 <?php comment_reply_link( array_merge( $args, array( 397 'depth' => $depth, 398 'max_depth' => $args['max_depth'], 399 ) ) ); ?> 400 </div><!-- .reply --> 401 </div><!-- #comment-## --> 396 402 397 <?php403 <?php 398 404 break; 399 case 'pingback' :400 case 'trackback' :401 ?>402 <li class="post pingback">405 case 'pingback' : 406 case 'trackback' : 407 ?> 408 <li class="post pingback"> 403 409 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p> 404 410 <?php 405 411 break; 406 endswitch;407 }412 endswitch; 413 } 408 414 endif; 409 415 410 416 /** … … 505 511 add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); 506 512 507 513 if ( ! function_exists( 'twentyten_posted_on' ) ) : 508 /**514 /** 509 515 * Print HTML with meta information for the current post-date/time and author. 510 516 * 511 517 * @since Twenty Ten 1.0 512 518 */ 513 function twentyten_posted_on() {514 printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),515 'meta-prep meta-prep-author',516 sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',517 get_permalink(),518 esc_attr( get_the_time() ),519 get_the_date()520 ),521 sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',522 get_author_posts_url( get_the_author_meta( 'ID' ) ),523 esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),524 get_the_author()525 )526 );527 }519 function twentyten_posted_on() { 520 printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), 521 'meta-prep meta-prep-author', 522 sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', 523 get_permalink(), 524 esc_attr( get_the_time() ), 525 get_the_date() 526 ), 527 sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 528 get_author_posts_url( get_the_author_meta( 'ID' ) ), 529 esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ), 530 get_the_author() 531 ) 532 ); 533 } 528 534 endif; 529 535 530 536 if ( ! function_exists( 'twentyten_posted_in' ) ) : 531 /**537 /** 532 538 * Print HTML with meta information for the current post (category, tags and permalink). 533 539 * 534 540 * @since Twenty Ten 1.0 535 541 */ 536 function twentyten_posted_in() { 537 // Retrieves tag list of current post, separated by commas. 538 $tag_list = get_the_tag_list( '', ', ' ); 539 if ( $tag_list ) { 540 $posted_in = __( '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>.', 'twentyten' ); 541 } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { 542 $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); 543 } else { 544 $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); 542 function twentyten_posted_in() { 543 // Retrieves tag list of current post, separated by commas. 544 $tag_list = get_the_tag_list( '', ', ' ); 545 if ( $tag_list ) { 546 $posted_in = __( '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>.', 'twentyten' ); 547 } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { 548 $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); 549 } else { 550 $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); 551 } 552 // Prints the string, replacing the placeholders. 553 printf( 554 $posted_in, 555 get_the_category_list( ', ' ), 556 $tag_list, 557 get_permalink(), 558 the_title_attribute( 'echo=0' ) 559 ); 545 560 } 546 // Prints the string, replacing the placeholders.547 printf(548 $posted_in,549 get_the_category_list( ', ' ),550 $tag_list,551 get_permalink(),552 the_title_attribute( 'echo=0' )553 );554 }555 561 endif; 556 562 557 563 /** … … 569 575 570 576 if ( function_exists( 'get_post_galleries' ) ) { 571 577 $galleries = get_post_galleries( get_the_ID(), false ); 572 if ( isset( $galleries[0]['ids'] ) ) 578 if ( isset( $galleries[0]['ids'] ) ) { 573 579 $images = explode( ',', $galleries[0]['ids'] ); 580 } 574 581 } else { 575 582 $pattern = get_shortcode_regex(); 576 583 preg_match( "/$pattern/s", get_the_content(), $match ); 577 584 $atts = shortcode_parse_atts( $match[3] ); 578 if ( isset( $atts['ids'] ) ) 585 if ( isset( $atts['ids'] ) ) { 579 586 $images = explode( ',', $atts['ids'] ); 587 } 580 588 } 581 589 582 590 if ( ! $images ) { -
src/wp-content/themes/twentyten/header.php
25 25 26 26 // Add the blog description for the home/front page. 27 27 $site_description = get_bloginfo( 'description', 'display' ); 28 if ( $site_description && ( is_home() || is_front_page() ) ) 29 echo " | $site_description"; 28 if ( $site_description && ( is_home() || is_front_page() ) ) { 29 echo " | $site_description"; 30 } 30 31 31 32 // Add a page number if necessary: 32 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) 33 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) ); 33 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { 34 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) ); 35 } 34 36 35 37 ?></title> 36 38 <link rel="profile" href="http://gmpg.org/xfn/11" /> … … 41 43 * We add some JavaScript to pages with the comment form 42 44 * to support sites with threaded comments (when in use). 43 45 */ 44 if ( is_singular() && get_option( 'thread_comments' ) ) 45 wp_enqueue_script( 'comment-reply' ); 46 if ( is_singular() && get_option( 'thread_comments' ) ) { 47 wp_enqueue_script( 'comment-reply' ); 48 } 46 49 47 50 /* 48 51 * Always have wp_head() just before the closing </head> … … 69 72 70 73 <?php 71 74 // Compatibility with versions of WordPress prior to 3.4. 72 73 74 75 76 77 78 79 80 75 if ( function_exists( 'get_custom_header' ) ) { 76 /* 77 * We need to figure out what the minimum width should be for our featured image. 78 * This result would be the suggested width if the theme were to implement flexible widths. 79 */ 80 $header_image_width = get_theme_support( 'custom-header', 'width' ); 81 } else { 82 $header_image_width = HEADER_IMAGE_WIDTH; 83 } 81 84 82 85 // Check if this is a post or page, if it has a thumbnail, and if it's a big one 83 86 if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && 84 87 has_post_thumbnail( $post->ID ) && 85 88 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) && 86 89 $image[1] >= $header_image_width ) : 87 88 90 // Houston, we have a new header image! 91 echo get_the_post_thumbnail( $post->ID ); 89 92 elseif ( get_header_image() ) : 90 93 // Compatibility with versions of WordPress prior to 3.4. 91 94 if ( function_exists( 'get_custom_header' ) ) { … … 101 104 </div><!-- #branding --> 102 105 103 106 <div id="access" role="navigation"> 104 107 <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> 105 108 <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div> 106 109 <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> 107 110 <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> -
src/wp-content/themes/twentyten/loop-attachment.php
15 15 */ 16 16 ?> 17 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>18 <?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?> 19 19 20 20 <?php if ( ! empty( $post->post_parent ) ) : ?> 21 21 <p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php … … 47 47 get_the_date() 48 48 ) 49 49 ); 50 51 52 53 54 55 56 57 58 59 60 61 50 if ( wp_attachment_is_image() ) { 51 echo ' <span class="meta-sep">|</span> '; 52 $metadata = wp_get_attachment_metadata(); 53 printf( __( 'Full size is %s pixels', 'twentyten' ), 54 sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>', 55 esc_url( wp_get_attachment_url() ), 56 esc_attr( __( 'Link to full-size image', 'twentyten' ) ), 57 $metadata['width'], 58 $metadata['height'] 59 ) 60 ); 61 } 62 62 ?> 63 63 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> 64 64 </div><!-- .entry-meta --> … … 66 66 <div class="entry-content"> 67 67 <div class="entry-attachment"> 68 68 <?php if ( wp_attachment_is_image() ) : 69 $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' ) ) ); 69 $attachments = array_values( get_children( array( 70 'post_parent' => $post->post_parent, 71 'post_status' => 'inherit', 72 'post_type' => 'attachment', 73 'post_mime_type' => 'image', 74 'order' => 'ASC', 75 'orderby' => 'menu_order ID', 76 ) ) ); 70 77 foreach ( $attachments as $k => $attachment ) { 71 if ( $attachment->ID == $post->ID ) 78 if ( $attachment->ID == $post->ID ) { 72 79 break; 80 } 73 81 } 74 82 75 83 // If there is more than 1 image attachment in a gallery 76 84 if ( count( $attachments ) > 1 ) { 77 85 $k++; 78 if ( isset( $attachments[ $k ] ) ) 86 if ( isset( $attachments[ $k ] ) ) { 79 87 // get the URL of the next image attachment 80 88 $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 81 else 82 // or get the URL of the first image attachment 89 } else { // End if(). 83 90 $next_attachment_url = get_attachment_link( $attachments[0]->ID ); 91 } 84 92 } else { 85 93 // or, if there's only 1 image attachment, get the URL of the image 86 94 $next_attachment_url = wp_get_attachment_url(); … … 114 122 <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a> 115 123 <?php endif; ?> 116 124 </div><!-- .entry-attachment --> 117 <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt();?></div>125 <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) { the_excerpt();} ?></div> 118 126 119 127 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 120 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 128 <?php wp_link_pages( array( 129 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 130 'after' => '</div>', 131 ) ); ?> 121 132 122 133 </div><!-- .entry-content --> 123 134 … … 129 140 130 141 <?php comments_template(); ?> 131 142 132 <?php endwhile; // end of the loop. ?> 143 <?php endwhile; 144 }; // End if(). 145 ?> -
src/wp-content/themes/twentyten/loop-page.php
15 15 */ 16 16 ?> 17 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>18 <?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?> 19 19 20 20 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 21 21 <?php if ( is_front_page() ) { ?> … … 26 26 27 27 <div class="entry-content"> 28 28 <?php the_content(); ?> 29 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 29 <?php wp_link_pages( array( 30 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 31 'after' => '</div>', 32 ) ); ?> 30 33 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> 31 34 </div><!-- .entry-content --> 32 35 </div><!-- #post-## --> 33 36 34 37 <?php comments_template( '', true ); ?> 35 38 36 <?php endwhile; // end of the loop. ?> 39 <?php endwhile; 40 }; // End if(). 41 ?> -
src/wp-content/themes/twentyten/loop-single.php
15 15 */ 16 16 ?> 17 17 18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>18 <?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?> 19 19 20 20 <div id="nav-above" class="navigation"> 21 21 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> … … 31 31 32 32 <div class="entry-content"> 33 33 <?php the_content(); ?> 34 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 34 <?php wp_link_pages( array( 35 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 36 'after' => '</div>', 37 ) ); ?> 35 38 </div><!-- .entry-content --> 36 39 37 40 <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?> … … 67 70 68 71 <?php comments_template( '', true ); ?> 69 72 70 <?php endwhile; // end of the loop. ?> 73 <?php endwhile; 74 }; // End if(). 75 ?> -
src/wp-content/themes/twentyten/loop.php
73 73 <?php else : ?> 74 74 <?php 75 75 $images = twentyten_get_gallery_images(); 76 77 78 76 if ( $images ) : 77 $total_images = count( $images ); 78 $image = reset( $images ); 79 79 ?> 80 81 82 83 84 85 86 80 <div class="gallery-thumb"> 81 <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a> 82 </div><!-- .gallery-thumb --> 83 <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ), 84 'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"', 85 number_format_i18n( $total_images ) 86 ); ?></em></p> 87 87 <?php endif; // end twentyten_get_gallery_images() check ?> 88 88 <?php the_excerpt(); ?> 89 89 <?php endif; ?> … … 104 104 105 105 <?php /* How to display posts of the Aside format. The asides category is the old way. */ ?> 106 106 107 <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) 107 <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?> 108 108 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 109 109 110 110 <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?> … … 142 142 <?php else : ?> 143 143 <div class="entry-content"> 144 144 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?> 145 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> 145 <?php wp_link_pages( array( 146 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 147 'after' => '</div>', 148 ) ); ?> 146 149 </div><!-- .entry-content --> 147 150 <?php endif; ?> 148 151 … … 155 158 <?php endif; ?> 156 159 <?php 157 160 $tags_list = get_the_tag_list( '', ', ' ); 158 if ( $tags_list ):161 if ( $tags_list ) : 159 162 ?> 160 161 162 163 163 <span class="tag-links"> 164 <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> 165 </span> 166 <span class="meta-sep">|</span> 164 167 <?php endif; ?> 165 168 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span> 166 169 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?> … … 174 177 <?php endwhile; // End the loop. Whew. ?> 175 178 176 179 <?php /* Display navigation to next/previous pages when applicable */ ?> 177 <?php if ( 180 <?php if ( $wp_query->max_num_pages > 1 ) : ?> 178 181 <div id="nav-below" class="navigation"> 179 182 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div> 180 183 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div> -
src/wp-content/themes/twentyten/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( 'first-footer-widget-area')18 if ( ! is_active_sidebar( 'first-footer-widget-area' ) 19 19 && ! is_active_sidebar( 'second-footer-widget-area' ) 20 && ! is_active_sidebar( 'third-footer-widget-area' 20 && ! is_active_sidebar( 'third-footer-widget-area' ) 21 21 && ! is_active_sidebar( 'fourth-footer-widget-area' ) 22 ) 23 return; 22 ) { 23 return; 24 } 24 25 // If we get this far, we have widgets. Let do this. 25 26 ?> 26 27 -
src/wp-content/themes/twentyten/sidebar.php
18 18 * then the sidebar simply doesn't exist, so we'll hard-code in 19 19 * some default sidebar stuff just in case. 20 20 */ 21 21 if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?> 22 22 23 23 <li id="search" class="widget-container widget_search"> 24 24 <?php get_search_form(); ?> … … 46 46 47 47 <?php 48 48 // A second sidebar for widgets, just because. 49 49 if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?> 50 50 51 51 <div id="secondary" class="widget-area" role="complementary"> 52 52 <ul class="xoxo"> -
src/wp-content/themes/twentythirteen/404.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/twentythirteen/archive.php
25 25 <?php if ( have_posts() ) : ?> 26 26 <header class="archive-header"> 27 27 <h1 class="archive-title"><?php 28 29 28 if ( is_day() ) : 29 printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() ); 30 30 elseif ( is_month() ) : 31 31 printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) ); 32 32 elseif ( is_year() ) : -
src/wp-content/themes/twentythirteen/author-bio.php
31 31 </a> 32 32 </p> 33 33 </div><!-- .author-description --> 34 </div><!-- .author-info --> 35 No newline at end of file 34 </div><!-- .author-info --> -
src/wp-content/themes/twentythirteen/comments.php
13 13 * If the current post is protected by a password and the visitor has not yet 14 14 * entered the password we will return early without loading the comments. 15 15 */ 16 if ( post_password_required() ) 16 if ( post_password_required() ) { 17 17 return; 18 } 18 19 ?> 19 20 20 21 <div id="comments" class="comments-area"> … … 23 24 <h2 class="comments-title"> 24 25 <?php 25 26 printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentythirteen' ), 26 27 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); 27 28 ?> 28 29 </h2> 29 30 … … 39 40 40 41 <?php 41 42 // Are there comments to navigate through? 42 43 if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : 43 44 ?> 44 45 <nav class="navigation comment-navigation" role="navigation"> 45 46 47 46 <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1> 47 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentythirteen' ) ); ?></div> 48 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentythirteen' ) ); ?></div> 48 49 </nav><!-- .comment-navigation --> 49 50 <?php endif; // Check for comment navigation ?> 50 51 … … 56 57 57 58 <?php comment_form(); ?> 58 59 59 </div><!-- #comments --> 60 No newline at end of file 60 </div><!-- #comments --> -
src/wp-content/themes/twentythirteen/content.php
45 45 the_title( '<span class="screen-reader-text">', '</span>', false ) 46 46 ) ); 47 47 48 wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); 48 wp_link_pages( array( 49 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 50 'after' => '</div>', 51 'link_before' => '<span>', 52 'link_after' => '</span>', 53 ) ); 49 54 ?> 50 55 </div><!-- .entry-content --> 51 56 <?php endif; ?> -
src/wp-content/themes/twentythirteen/footer.php
23 23 24 24 <?php wp_footer(); ?> 25 25 </body> 26 </html> 27 No newline at end of file 26 </html> -
src/wp-content/themes/twentythirteen/functions.php
28 28 * 29 29 * @see twentythirteen_content_width() for template-specific adjustments. 30 30 */ 31 if ( ! isset( $content_width ) ) 31 if ( ! isset( $content_width ) ) { 32 32 $content_width = 604; 33 } 33 34 34 35 /** 35 36 * Add support for a custom header image. … … 39 40 /** 40 41 * Twenty Thirteen only works in WordPress 3.6 or later. 41 42 */ 42 if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) 43 if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) { 43 44 require get_template_directory() . '/inc/back-compat.php'; 45 } 44 46 45 47 /** 46 48 * Twenty Thirteen setup. … … 82 84 * and comments to output valid HTML5. 83 85 */ 84 86 add_theme_support( 'html5', array( 85 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' 87 'search-form', 88 'comment-form', 89 'comment-list', 90 'gallery', 91 'caption', 86 92 ) ); 87 93 88 94 /* … … 90 96 * See https://codex.wordpress.org/Post_Formats 91 97 */ 92 98 add_theme_support( 'post-formats', array( 93 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' 99 'aside', 100 'audio', 101 'chat', 102 'gallery', 103 'image', 104 'link', 105 'quote', 106 'status', 107 'video', 94 108 ) ); 95 109 96 110 // This theme uses wp_nav_menu() in one location. … … 139 153 if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) { 140 154 $font_families = array(); 141 155 142 if ( 'off' !== $source_sans_pro ) 156 if ( 'off' !== $source_sans_pro ) { 143 157 $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic'; 158 } 144 159 145 if ( 'off' !== $bitter ) 160 if ( 'off' !== $bitter ) { 146 161 $font_families[] = 'Bitter:400,700'; 162 } 147 163 148 164 $query_args = array( 149 165 'family' => urlencode( implode( '|', $font_families ) ), … … 165 181 * Adds JavaScript to pages with the comment form to support 166 182 * sites with threaded comments (when in use). 167 183 */ 168 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) 184 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 169 185 wp_enqueue_script( 'comment-reply' ); 186 } 170 187 171 188 // Adds Masonry to handle vertical alignment of footer widgets. 172 if ( is_active_sidebar( 'sidebar-1' ) ) 189 if ( is_active_sidebar( 'sidebar-1' ) ) { 173 190 wp_enqueue_script( 'jquery-masonry' ); 191 } 174 192 175 193 // Loads JavaScript file with functionality specific to Twenty Thirteen. 176 194 wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true ); … … 230 248 function twentythirteen_wp_title( $title, $sep ) { 231 249 global $paged, $page; 232 250 233 if ( is_feed() ) 251 if ( is_feed() ) { 234 252 return $title; 253 } 235 254 236 255 // Add the site name. 237 256 $title .= get_bloginfo( 'name', 'display' ); 238 257 239 258 // Add the site description for the home/front page. 240 259 $site_description = get_bloginfo( 'description', 'display' ); 241 if ( $site_description && ( is_home() || is_front_page() ) ) 260 if ( $site_description && ( is_home() || is_front_page() ) ) { 242 261 $title = "$title $sep $site_description"; 262 } 243 263 244 264 // Add a page number if necessary. 245 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) 265 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { 246 266 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) ); 267 } 247 268 248 269 return $title; 249 270 } … … 278 299 add_action( 'widgets_init', 'twentythirteen_widgets_init' ); 279 300 280 301 if ( ! function_exists( 'twentythirteen_paging_nav' ) ) : 281 /**302 /** 282 303 * Display navigation to next/previous set of posts when applicable. 283 304 * 284 305 * @since Twenty Thirteen 1.0 285 306 */ 286 function twentythirteen_paging_nav() {287 global $wp_query;307 function twentythirteen_paging_nav() { 308 global $wp_query; 288 309 289 // Don't print empty markup if there's only one page. 290 if ( $wp_query->max_num_pages < 2 ) 291 return; 292 ?> 293 <nav class="navigation paging-navigation" role="navigation"> 310 // Don't print empty markup if there's only one page. 311 if ( $wp_query->max_num_pages < 2 ) { 312 return; 313 } 314 ?> 315 <nav class="navigation paging-navigation" role="navigation"> 294 316 <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1> 295 317 <div class="nav-links"> 296 318 … … 303 325 <?php endif; ?> 304 326 305 327 </div><!-- .nav-links --> 306 </nav><!-- .navigation -->307 <?php308 }328 </nav><!-- .navigation --> 329 <?php 330 } 309 331 endif; 310 332 311 333 if ( ! function_exists( 'twentythirteen_post_nav' ) ) : 312 /**334 /** 313 335 * Display navigation to next/previous post when applicable. 314 336 * 315 337 * @since Twenty Thirteen 1.0 316 338 */ 317 function twentythirteen_post_nav() {318 global $post;339 function twentythirteen_post_nav() { 340 global $post; 319 341 320 // Don't print empty markup if there's nowhere to navigate. 321 $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); 322 $next = get_adjacent_post( false, '', false ); 323 324 if ( ! $next && ! $previous ) 325 return; 326 ?> 327 <nav class="navigation post-navigation" role="navigation"> 342 // Don't print empty markup if there's nowhere to navigate. 343 $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); 344 $next = get_adjacent_post( false, '', false ); 345 346 if ( ! $next && ! $previous ) { 347 return; 348 } 349 ?> 350 <nav class="navigation post-navigation" role="navigation"> 328 351 <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1> 329 352 <div class="nav-links"> 330 353 … … 332 355 <?php next_post_link( '%link', _x( '%title <span class="meta-nav">→</span>', 'Next post link', 'twentythirteen' ) ); ?> 333 356 334 357 </div><!-- .nav-links --> 335 </nav><!-- .navigation -->336 <?php337 }358 </nav><!-- .navigation --> 359 <?php 360 } 338 361 endif; 339 362 340 363 if ( ! function_exists( 'twentythirteen_entry_meta' ) ) : 341 /**364 /** 342 365 * Print HTML with meta information for current post: categories, tags, permalink, author, and date. 343 366 * 344 367 * Create your own twentythirteen_entry_meta() to override in a child theme. 345 368 * 346 369 * @since Twenty Thirteen 1.0 347 370 */ 348 function twentythirteen_entry_meta() { 349 if ( is_sticky() && is_home() && ! is_paged() ) 350 echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>'; 351 352 if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) 353 twentythirteen_entry_date(); 354 355 // Translators: used between list items, there is a space after the comma. 356 $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) ); 357 if ( $categories_list ) { 358 echo '<span class="categories-links">' . $categories_list . '</span>'; 359 } 360 361 // Translators: used between list items, there is a space after the comma. 362 $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) ); 363 if ( $tag_list ) { 364 echo '<span class="tags-links">' . $tag_list . '</span>'; 365 } 366 367 // Post author 368 if ( 'post' == get_post_type() ) { 369 printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', 370 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 371 esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ), 372 get_the_author() 373 ); 371 function twentythirteen_entry_meta() { 372 if ( is_sticky() && is_home() && ! is_paged() ) { 373 echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>'; 374 } 375 376 if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) { 377 twentythirteen_entry_date(); 378 } 379 380 // Translators: used between list items, there is a space after the comma. 381 $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) ); 382 if ( $categories_list ) { 383 echo '<span class="categories-links">' . $categories_list . '</span>'; 384 } 385 386 // Translators: used between list items, there is a space after the comma. 387 $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) ); 388 if ( $tag_list ) { 389 echo '<span class="tags-links">' . $tag_list . '</span>'; 390 } 391 392 // Post author 393 if ( 'post' == get_post_type() ) { 394 printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', 395 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 396 esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ), 397 get_the_author() 398 ); 399 } 374 400 } 375 }376 401 endif; 377 402 378 403 if ( ! function_exists( 'twentythirteen_entry_date' ) ) : 379 /**404 /** 380 405 * Print HTML with date information for current post. 381 406 * 382 407 * Create your own twentythirteen_entry_date() to override in a child theme. … … 386 411 * @param boolean $echo (optional) Whether to echo the date. Default true. 387 412 * @return string The HTML-formatted post date. 388 413 */ 389 function twentythirteen_entry_date( $echo = true ) { 390 if ( has_post_format( array( 'chat', 'status' ) ) ) 391 $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' ); 392 else 393 $format_prefix = '%2$s'; 394 395 $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>', 396 esc_url( get_permalink() ), 397 esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ), 398 esc_attr( get_the_date( 'c' ) ), 399 esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) 400 ); 414 function twentythirteen_entry_date( $echo = true ) { 415 if ( has_post_format( array( 'chat', 'status' ) ) ) { 416 $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' ); 417 } else { $format_prefix = '%2$s'; 418 } 401 419 402 if ( $echo ) 403 echo $date; 420 $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>', 421 esc_url( get_permalink() ), 422 esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ), 423 esc_attr( get_the_date( 'c' ) ), 424 esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) ) 425 ); 404 426 405 return $date; 406 } 427 if ( $echo ) { 428 echo $date; 429 } 430 431 return $date; 432 } 407 433 endif; 408 434 409 435 if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) : 410 /**436 /** 411 437 * Print the attached image with a link to the next attached image. 412 438 * 413 439 * @since Twenty Thirteen 1.0 414 440 */ 415 function twentythirteen_the_attached_image() {416 /**441 function twentythirteen_the_attached_image() { 442 /** 417 443 * Filter the image attachment size to use. 418 444 * 419 445 * @since Twenty thirteen 1.0 … … 423 449 * @type int The attachment width in pixels. 424 450 * } 425 451 */ 426 $attachment_size = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) ); 427 $next_attachment_url = wp_get_attachment_url(); 428 $post = get_post(); 452 $attachment_size = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) ); 453 $next_attachment_url = wp_get_attachment_url(); 454 $post = get_post(); 455 456 /* 457 * Grab the IDs of all the image attachments in a gallery so we can get the URL 458 * of the next adjacent image in a gallery, or the first image (if we're 459 * looking at the last image in a gallery), or, in a gallery of one, just the 460 * link to that image file. 461 */ 462 $attachment_ids = get_posts( array( 463 'post_parent' => $post->post_parent, 464 'fields' => 'ids', 465 'numberposts' => -1, 466 'post_status' => 'inherit', 467 'post_type' => 'attachment', 468 'post_mime_type' => 'image', 469 'order' => 'ASC', 470 'orderby' => 'menu_order ID', 471 ) ); 429 472 430 /* 431 * Grab the IDs of all the image attachments in a gallery so we can get the URL 432 * of the next adjacent image in a gallery, or the first image (if we're 433 * looking at the last image in a gallery), or, in a gallery of one, just the 434 * link to that image file. 435 */ 436 $attachment_ids = get_posts( array( 437 'post_parent' => $post->post_parent, 438 'fields' => 'ids', 439 'numberposts' => -1, 440 'post_status' => 'inherit', 441 'post_type' => 'attachment', 442 'post_mime_type' => 'image', 443 'order' => 'ASC', 444 'orderby' => 'menu_order ID', 445 ) ); 473 // If there is more than 1 attachment in a gallery... 474 if ( count( $attachment_ids ) > 1 ) { 475 foreach ( $attachment_ids as $idx => $attachment_id ) { 476 if ( $attachment_id == $post->ID ) { 477 $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; 478 break; 479 } 480 } 446 481 447 // If there is more than 1 attachment in a gallery... 448 if ( count( $attachment_ids ) > 1 ) { 449 foreach ( $attachment_ids as $idx => $attachment_id ) { 450 if ( $attachment_id == $post->ID ) { 451 $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; 452 break; 482 // get the URL of the next image attachment... 483 if ( $next_id ) { 484 $next_attachment_url = get_attachment_link( $next_id ); 485 } // End if(). 486 else { $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); 453 487 } 454 488 } 455 489 456 // get the URL of the next image attachment...457 if ( $next_id )458 $next_attachment_url = get_attachment_link( $next_id );459 460 // or get the URL of the first image attachment.461 else462 $next_attachment_url = get_attachment_link( reset( $attachment_ids ));490 printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>', 491 esc_url( $next_attachment_url ), 492 the_title_attribute( array( 493 'echo' => false, 494 ) ), 495 wp_get_attachment_image( $post->ID, $attachment_size ) 496 ); 463 497 } 464 465 printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',466 esc_url( $next_attachment_url ),467 the_title_attribute( array( 'echo' => false ) ),468 wp_get_attachment_image( $post->ID, $attachment_size )469 );470 }471 498 endif; 472 499 473 500 /** … … 490 517 } 491 518 492 519 if ( ! function_exists( 'twentythirteen_excerpt_more' ) && ! is_admin() ) : 493 /**520 /** 494 521 * Replaces "[...]" (appended to automatically generated excerpts) with ... 495 522 * and a Continue reading link. 496 523 * … … 499 526 * @param string $more Default Read More excerpt link. 500 527 * @return string Filtered Read More excerpt link. 501 528 */ 502 function twentythirteen_excerpt_more( $more ) {503 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',504 esc_url( get_permalink( get_the_ID() ) ),529 function twentythirteen_excerpt_more( $more ) { 530 $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>', 531 esc_url( get_permalink( get_the_ID() ) ), 505 532 /* translators: %s: Name of current post */ 506 533 sprintf( __( 'Continue reading %s <span class="meta-nav">→</span>', 'twentythirteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' ) 507 534 ); 508 return ' … ' . $link;509 }510 add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );535 return ' … ' . $link; 536 } 537 add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' ); 511 538 endif; 512 539 513 540 /** … … 524 551 * @return array The filtered body class list. 525 552 */ 526 553 function twentythirteen_body_class( $classes ) { 527 if ( ! is_multi_author() ) 554 if ( ! is_multi_author() ) { 528 555 $classes[] = 'single-author'; 556 } 529 557 530 if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) 558 if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) { 531 559 $classes[] = 'sidebar'; 560 } 532 561 533 if ( ! get_option( 'show_avatars' ) ) 562 if ( ! get_option( 'show_avatars' ) ) { 534 563 $classes[] = 'no-avatars'; 564 } 535 565 536 566 return $classes; 537 567 } … … 545 575 function twentythirteen_content_width() { 546 576 global $content_width; 547 577 548 if ( is_attachment() ) 578 if ( is_attachment() ) { 549 579 $content_width = 724; 550 elseif ( has_post_format( 'audio' ) )580 } elseif ( has_post_format( 'audio' ) ) { 551 581 $content_width = 484; 582 } 552 583 } 553 584 add_action( 'template_redirect', 'twentythirteen_content_width' ); 554 585 -
src/wp-content/themes/twentythirteen/image.php
16 16 17 17 <?php 18 18 // Start the Loop. 19 19 while ( have_posts() ) : the_post(); 20 20 ?> 21 21 22 22 <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>> 23 24 23 <header class="entry-header"> 24 <h1 class="entry-title"><?php the_title(); ?></h1> 25 25 26 <div class="entry-meta"> 27 <?php 28 $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' ); 29 $post_title = get_the_title( $post->post_parent ); 30 if ( empty( $post_title ) || 0 == $post->post_parent ) 31 $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>'; 32 33 printf( $published_text, 34 esc_attr( get_the_date( 'c' ) ), 35 esc_html( get_the_date() ), 36 esc_url( get_permalink( $post->post_parent ) ), 37 esc_attr( strip_tags( $post_title ) ), 38 $post_title 39 ); 40 41 $metadata = wp_get_attachment_metadata(); 42 printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s × %5$s)</a></span>', 43 esc_url( wp_get_attachment_url() ), 44 esc_attr__( 'Link to full-size image', 'twentythirteen' ), 45 __( 'Full resolution', 'twentythirteen' ), 46 $metadata['width'], 47 $metadata['height'] 48 ); 49 50 edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); 51 ?> 52 </div><!-- .entry-meta --> 26 <div class="entry-meta"> 27 <?php 28 $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' ); 29 $post_title = get_the_title( $post->post_parent ); 30 if ( empty( $post_title ) || 0 == $post->post_parent ) { 31 $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>'; 32 } 33 34 printf( $published_text, 35 esc_attr( get_the_date( 'c' ) ), 36 esc_html( get_the_date() ), 37 esc_url( get_permalink( $post->post_parent ) ), 38 esc_attr( strip_tags( $post_title ) ), 39 $post_title 40 ); 41 42 $metadata = wp_get_attachment_metadata(); 43 printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s × %5$s)</a></span>', 44 esc_url( wp_get_attachment_url() ), 45 esc_attr__( 'Link to full-size image', 'twentythirteen' ), 46 __( 'Full resolution', 'twentythirteen' ), 47 $metadata['width'], 48 $metadata['height'] 49 ); 50 51 edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); 52 ?> 53 </div><!-- .entry-meta --> 53 54 </header><!-- .entry-header --> 54 55 55 56 <div class="entry-content"> 56 57 58 57 <nav id="image-navigation" class="navigation image-navigation" role="navigation"> 58 <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">←</span> Previous', 'twentythirteen' ) ); ?></span> 59 <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?></span> 59 60 </nav><!-- #image-navigation --> 60 61 61 62 <div class="entry-attachment"> 62 63 63 <div class="attachment"> 64 <?php twentythirteen_the_attached_image(); ?> 64 65 65 66 <?php if ( has_excerpt() ) : ?> 66 67 <div class="entry-caption"> 67 68 <?php the_excerpt(); ?> 68 69 </div> 69 70 <?php endif; ?> 70 71 </div><!-- .attachment --> 71 72 </div><!-- .entry-attachment --> 72 73 73 74 <?php if ( ! empty( $post->post_content ) ) : ?> 74 75 <div class="entry-description"> 75 76 <?php the_content(); ?> 76 <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?> 77 <?php wp_link_pages( array( 78 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 79 'after' => '</div>', 80 ) ); ?> 77 81 </div><!-- .entry-description --> 78 82 <?php endif; ?> 79 83 -
src/wp-content/themes/twentythirteen/inc/custom-header.php
46 46 'circle' => array( 47 47 'url' => '%s/images/headers/circle.png', 48 48 'thumbnail_url' => '%s/images/headers/circle-thumbnail.png', 49 'description' => _x( 'Circle', 'header image description', 'twentythirteen' ) 49 'description' => _x( 'Circle', 'header image description', 'twentythirteen' ), 50 50 ), 51 51 'diamond' => array( 52 52 'url' => '%s/images/headers/diamond.png', 53 53 'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png', 54 'description' => _x( 'Diamond', 'header image description', 'twentythirteen' ) 54 'description' => _x( 'Diamond', 'header image description', 'twentythirteen' ), 55 55 ), 56 56 'star' => array( 57 57 'url' => '%s/images/headers/star.png', 58 58 'thumbnail_url' => '%s/images/headers/star-thumbnail.png', 59 'description' => _x( 'Star', 'header image description', 'twentythirteen' ) 59 'description' => _x( 'Star', 'header image description', 'twentythirteen' ), 60 60 ), 61 61 ) ); 62 62 } … … 88 88 $text_color = get_header_textcolor(); 89 89 90 90 // If no custom options for text are set, let's bail. 91 if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) 91 if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) { 92 92 return; 93 } 93 94 94 95 // If we get this far, we have custom styles. 95 96 ?> 96 97 <style type="text/css" id="twentythirteen-header-css"> 97 98 <?php 98 99 if ( ! empty( $header_image ) ) : 99 100 ?> 100 101 102 103 104 105 106 107 108 109 110 111 112 113 101 .site-header { 102 background: url(<?php header_image(); ?>) no-repeat scroll top; 103 background-size: 1600px auto; 104 } 105 @media (max-width: 767px) { 106 .site-header { 107 background-size: 768px auto; 108 } 109 } 110 @media (max-width: 359px) { 111 .site-header { 112 background-size: 360px auto; 113 } 114 } 114 115 <?php 115 116 endif; 116 117 117 118 // Has the text been hidden? 118 119 if ( ! display_header_text() ) : 119 120 ?> 120 121 122 123 124 125 121 .site-title, 122 .site-description { 123 position: absolute; 124 clip: rect(1px 1px 1px 1px); /* IE7 */ 125 clip: rect(1px, 1px, 1px, 1px); 126 } 126 127 <?php 127 128 if ( empty( $header_image ) ) : 128 129 ?> 129 130 131 130 .site-header .home-link { 131 min-height: 0; 132 } 132 133 <?php 133 134 endif; 134 135 135 136 // If the user has set a custom color for the text, use that. 136 137 elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) : 137 138 ?> 138 139 .site-title, -
src/wp-content/themes/twentythirteen/page.php
32 32 33 33 <div class="entry-content"> 34 34 <?php the_content(); ?> 35 <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> 35 <?php wp_link_pages( array( 36 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 37 'after' => '</div>', 38 'link_before' => '<span>', 39 'link_after' => '</span>', 40 ) ); ?> 36 41 </div><!-- .entry-content --> 37 42 38 43 <footer class="entry-meta"> … … 47 52 </div><!-- #primary --> 48 53 49 54 <?php get_sidebar(); ?> 50 <?php get_footer(); ?> 51 No newline at end of file 55 <?php get_footer(); ?> -
src/wp-content/themes/twentythirteen/search.php
33 33 </div><!-- #primary --> 34 34 35 35 <?php get_sidebar(); ?> 36 <?php get_footer(); ?> 37 No newline at end of file 36 <?php get_footer(); ?> -
src/wp-content/themes/twentythirteen/sidebar-main.php
15 15 <?php dynamic_sidebar( 'sidebar-1' ); ?> 16 16 </div><!-- .widget-area --> 17 17 </div><!-- #secondary --> 18 <?php endif; ?> 19 No newline at end of file 18 <?php endif; ?> -
src/wp-content/themes/twentythirteen/sidebar.php
19 19 </div><!-- .widget-area --> 20 20 </div><!-- .sidebar-inner --> 21 21 </div><!-- #tertiary --> 22 <?php endif; ?> 23 No newline at end of file 22 <?php endif; ?> -
src/wp-content/themes/twentythirteen/single.php
25 25 </div><!-- #primary --> 26 26 27 27 <?php get_sidebar(); ?> 28 <?php get_footer(); ?> 29 No newline at end of file 28 <?php get_footer(); ?> -
src/wp-content/themes/twentytwelve/404.php
26 26 </div><!-- #content --> 27 27 </div><!-- #primary --> 28 28 29 <?php get_footer(); ?> 30 No newline at end of file 29 <?php get_footer(); ?> -
src/wp-content/themes/twentytwelve/archive.php
25 25 <?php if ( have_posts() ) : ?> 26 26 <header class="archive-header"> 27 27 <h1 class="archive-title"><?php 28 29 28 if ( is_day() ) : 29 printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' ); 30 30 elseif ( is_month() ) : 31 31 printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' ); 32 32 elseif ( is_year() ) : -
src/wp-content/themes/twentytwelve/comments.php
17 17 * the visitor has not yet entered the password we will 18 18 * return early without loading the comments. 19 19 */ 20 if ( post_password_required() ) 20 if ( post_password_required() ) { 21 21 return; 22 } 22 23 ?> 23 24 24 25 <div id="comments" class="comments-area"> … … 29 30 <h2 class="comments-title"> 30 31 <?php 31 32 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ), 32 33 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); 33 34 ?> 34 35 </h2> 35 36 36 37 <ol class="commentlist"> 37 <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?> 38 <?php wp_list_comments( array( 39 'callback' => 'twentytwelve_comment', 40 'style' => 'ol', 41 ) ); ?> 38 42 </ol><!-- .commentlist --> 39 43 40 44 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> … … 57 61 58 62 <?php comment_form(); ?> 59 63 60 </div><!-- #comments .comments-area --> 61 No newline at end of file 64 </div><!-- #comments .comments-area --> -
src/wp-content/themes/twentytwelve/footer.php
20 20 21 21 <?php wp_footer(); ?> 22 22 </body> 23 </html> 24 No newline at end of file 23 </html> -
src/wp-content/themes/twentytwelve/functions.php
23 23 */ 24 24 25 25 // Set up the content width value based on the theme's design and stylesheet. 26 if ( ! isset( $content_width ) ) 26 if ( ! isset( $content_width ) ) { 27 27 $content_width = 625; 28 } 28 29 29 30 /** 30 31 * Twenty Twelve setup. … … 109 110 */ 110 111 $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' ); 111 112 112 if ( 'cyrillic' == $subset ) 113 if ( 'cyrillic' == $subset ) { 113 114 $subsets .= ',cyrillic,cyrillic-ext'; 114 elseif ( 'greek' == $subset )115 } elseif ( 'greek' == $subset ) { 115 116 $subsets .= ',greek,greek-ext'; 116 elseif ( 'vietnamese' == $subset )117 } elseif ( 'vietnamese' == $subset ) { 117 118 $subsets .= ',vietnamese'; 119 } 118 120 119 121 $query_args = array( 120 122 'family' => 'Open+Sans:400italic,700italic,400,700', … … 138 140 * Adds JavaScript to pages with the comment form to support 139 141 * sites with threaded comments (when in use). 140 142 */ 141 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) 143 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 142 144 wp_enqueue_script( 'comment-reply' ); 145 } 143 146 144 147 // Adds JavaScript for handling the navigation menu hide-and-show behavior. 145 148 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true ); 146 149 147 150 $font_url = twentytwelve_get_font_url(); 148 if ( ! empty( $font_url ) ) 151 if ( ! empty( $font_url ) ) { 149 152 wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); 153 } 150 154 151 155 // Loads our main stylesheet. 152 156 wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() ); … … 197 201 function twentytwelve_mce_css( $mce_css ) { 198 202 $font_url = twentytwelve_get_font_url(); 199 203 200 if ( empty( $font_url ) ) 204 if ( empty( $font_url ) ) { 201 205 return $mce_css; 206 } 202 207 203 if ( ! empty( $mce_css ) ) 208 if ( ! empty( $mce_css ) ) { 204 209 $mce_css .= ','; 210 } 205 211 206 212 $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) ); 207 213 … … 224 230 function twentytwelve_wp_title( $title, $sep ) { 225 231 global $paged, $page; 226 232 227 if ( is_feed() ) 233 if ( is_feed() ) { 228 234 return $title; 235 } 229 236 230 237 // Add the site name. 231 238 $title .= get_bloginfo( 'name', 'display' ); 232 239 233 240 // Add the site description for the home/front page. 234 241 $site_description = get_bloginfo( 'description', 'display' ); 235 if ( $site_description && ( is_home() || is_front_page() ) ) 242 if ( $site_description && ( is_home() || is_front_page() ) ) { 236 243 $title = "$title $sep $site_description"; 244 } 237 245 238 246 // Add a page number if necessary. 239 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) 247 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { 240 248 $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) ); 249 } 241 250 242 251 return $title; 243 252 } … … 251 260 * @since Twenty Twelve 1.0 252 261 */ 253 262 function twentytwelve_page_menu_args( $args ) { 254 if ( ! isset( $args['show_home'] ) ) 263 if ( ! isset( $args['show_home'] ) ) { 255 264 $args['show_home'] = true; 265 } 256 266 return $args; 257 267 } 258 268 add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' ); … … 298 308 add_action( 'widgets_init', 'twentytwelve_widgets_init' ); 299 309 300 310 if ( ! function_exists( 'twentytwelve_content_nav' ) ) : 301 /**311 /** 302 312 * Displays navigation to next/previous pages when applicable. 303 313 * 304 314 * @since Twenty Twelve 1.0 305 315 */ 306 function twentytwelve_content_nav( $html_id ) {307 global $wp_query;316 function twentytwelve_content_nav( $html_id ) { 317 global $wp_query; 308 318 309 if ( $wp_query->max_num_pages > 1 ) : ?>310 <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation">311 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>312 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div>313 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div>314 </nav><!-- .navigation -->315 <?php endif;316 }319 if ( $wp_query->max_num_pages > 1 ) : ?> 320 <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation"> 321 <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3> 322 <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div> 323 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div> 324 </nav><!-- .navigation --> 325 <?php endif; 326 } 317 327 endif; 318 328 319 329 if ( ! function_exists( 'twentytwelve_comment' ) ) : 320 /**330 /** 321 331 * Template for comments and pingbacks. 322 332 * 323 333 * To override this walker in a child theme without modifying the comments template … … 327 337 * 328 338 * @since Twenty Twelve 1.0 329 339 */ 330 function twentytwelve_comment( $comment, $args, $depth ) {331 $GLOBALS['comment'] = $comment;332 switch ( $comment->comment_type ) :333 case 'pingback' :334 case 'trackback' :335 // Display trackbacks differently than normal comments.336 ?>337 <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">340 function twentytwelve_comment( $comment, $args, $depth ) { 341 $GLOBALS['comment'] = $comment; 342 switch ( $comment->comment_type ) : 343 case 'pingback' : 344 case 'trackback' : 345 // Display trackbacks differently than normal comments. 346 ?> 347 <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> 338 348 <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p> 339 349 <?php 340 350 break; 341 default :342 // Proceed with normal comments.343 global $post;344 ?>345 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">351 default : 352 // Proceed with normal comments. 353 global $post; 354 ?> 355 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> 346 356 <article id="comment-<?php comment_ID(); ?>" class="comment"> 347 357 <header class="comment-meta comment-author vcard"> 348 358 <?php … … 358 368 /* translators: 1: date, 2: time */ 359 369 sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() ) 360 370 ); 361 ?>362 </header><!-- .comment-meta -->371 ?> 372 </header><!-- .comment-meta --> 363 373 364 <?php if ( '0' == $comment->comment_approved ) : ?>374 <?php if ( '0' == $comment->comment_approved ) : ?> 365 375 <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p> 366 376 <?php endif; ?> 367 377 368 <section class="comment-content comment">378 <section class="comment-content comment"> 369 379 <?php comment_text(); ?> 370 380 <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?> 371 </section><!-- .comment-content -->381 </section><!-- .comment-content --> 372 382 373 <div class="reply"> 374 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 375 </div><!-- .reply --> 376 </article><!-- #comment-## --> 377 <?php 383 <div class="reply"> 384 <?php comment_reply_link( array_merge( $args, array( 385 'reply_text' => __( 'Reply', 'twentytwelve' ), 386 'after' => ' <span>↓</span>', 387 'depth' => $depth, 388 'max_depth' => $args['max_depth'], 389 ) ) ); ?> 390 </div><!-- .reply --> 391 </article><!-- #comment-## --> 392 <?php 378 393 break; 379 endswitch; // end comment_type check380 }394 endswitch; // end comment_type check 395 } 381 396 endif; 382 397 383 398 if ( ! function_exists( 'twentytwelve_entry_meta' ) ) : 384 /**399 /** 385 400 * Set up post entry meta. 386 401 * 387 402 * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. … … 390 405 * 391 406 * @since Twenty Twelve 1.0 392 407 */ 393 function twentytwelve_entry_meta() {394 // Translators: used between list items, there is a space after the comma.395 $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );396 397 // Translators: used between list items, there is a space after the comma.398 $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );399 400 $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',401 esc_url( get_permalink() ),402 esc_attr( get_the_time() ),403 esc_attr( get_the_date( 'c' ) ),404 esc_html( get_the_date() )405 );406 407 $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',408 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),409 esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),410 get_the_author()411 );412 413 // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.414 if ( $tag_list ) {415 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );416 } elseif ( $categories_list ) {417 $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );418 } else {419 $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );420 }421 422 printf(423 $utility_text,424 $categories_list,425 $tag_list,426 $date,427 $author428 );429 }408 function twentytwelve_entry_meta() { 409 // Translators: used between list items, there is a space after the comma. 410 $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) ); 411 412 // Translators: used between list items, there is a space after the comma. 413 $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); 414 415 $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', 416 esc_url( get_permalink() ), 417 esc_attr( get_the_time() ), 418 esc_attr( get_the_date( 'c' ) ), 419 esc_html( get_the_date() ) 420 ); 421 422 $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', 423 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 424 esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ), 425 get_the_author() 426 ); 427 428 // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. 429 if ( $tag_list ) { 430 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); 431 } elseif ( $categories_list ) { 432 $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); 433 } else { 434 $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' ); 435 } 436 437 printf( 438 $utility_text, 439 $categories_list, 440 $tag_list, 441 $date, 442 $author 443 ); 444 } 430 445 endif; 431 446 432 447 /** … … 450 465 $background_color = get_background_color(); 451 466 $background_image = get_background_image(); 452 467 453 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) 468 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) { 454 469 $classes[] = 'full-width'; 470 } 455 471 456 472 if ( is_page_template( 'page-templates/front-page.php' ) ) { 457 473 $classes[] = 'template-front-page'; 458 if ( has_post_thumbnail() ) 474 if ( has_post_thumbnail() ) { 459 475 $classes[] = 'has-post-thumbnail'; 460 if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) 476 } 477 if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) { 461 478 $classes[] = 'two-sidebars'; 479 } 462 480 } 463 481 464 482 if ( empty( $background_image ) ) { 465 if ( empty( $background_color ) ) 483 if ( empty( $background_color ) ) { 466 484 $classes[] = 'custom-background-empty'; 467 elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )485 } elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) { 468 486 $classes[] = 'custom-background-white'; 487 } 469 488 } 470 489 471 490 // Enable custom font class only if the font CSS is queued to load. 472 if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) 491 if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) { 473 492 $classes[] = 'custom-font-enabled'; 493 } 474 494 475 if ( ! is_multi_author() ) 495 if ( ! is_multi_author() ) { 476 496 $classes[] = 'single-author'; 497 } 477 498 478 499 return $classes; 479 500 } -
src/wp-content/themes/twentytwelve/header.php
50 50 <?php endif; ?> 51 51 </header><!-- #masthead --> 52 52 53 <div id="main" class="wrapper"> 54 No newline at end of file 53 <div id="main" class="wrapper"> -
src/wp-content/themes/twentytwelve/image.php
54 54 */ 55 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 56 foreach ( $attachments as $k => $attachment ) : 57 if ( $attachment->ID == $post->ID ) 57 if ( $attachment->ID == $post->ID ) { 58 58 break; 59 } 59 60 endforeach; 60 61 61 62 // If there is more than 1 attachment in a gallery … … 75 76 ?> 76 77 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php 77 78 /** 78 79 * Filter the image attachment size to use. 79 80 * 80 81 * @since Twenty Twelve 1.0 81 82 * -
src/wp-content/themes/twentytwelve/inc/custom-header.php
54 54 */ 55 55 function twentytwelve_custom_header_fonts() { 56 56 $font_url = twentytwelve_get_font_url(); 57 if ( ! empty( $font_url ) ) 57 if ( ! empty( $font_url ) ) { 58 58 wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); 59 } 59 60 } 60 61 add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' ); 61 62 … … 70 71 $text_color = get_header_textcolor(); 71 72 72 73 // If no custom options for text are set, let's bail 73 if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) 74 if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) { 74 75 return; 76 } 75 77 76 78 // If we get this far, we have custom styles. 77 79 ?> 78 80 <style type="text/css" id="twentytwelve-header-css"> 79 81 <?php 80 82 // Has the text been hidden? 81 83 if ( ! display_header_text() ) : 82 84 ?> 83 84 85 86 87 88 85 .site-title, 86 .site-description { 87 position: absolute; 88 clip: rect(1px 1px 1px 1px); /* IE7 */ 89 clip: rect(1px, 1px, 1px, 1px); 90 } 89 91 <?php 90 92 // If the user has set a custom color for the text, use that. 91 93 else : 92 94 ?> 93 95 .site-header h1 a, -
src/wp-content/themes/twentytwelve/page-templates/front-page.php
32 32 </div><!-- #primary --> 33 33 34 34 <?php get_sidebar( 'front' ); ?> 35 <?php get_footer(); ?> 36 No newline at end of file 35 <?php get_footer(); ?> -
src/wp-content/themes/twentytwelve/page-templates/full-width.php
27 27 </div><!-- #content --> 28 28 </div><!-- #primary --> 29 29 30 <?php get_footer(); ?> 31 No newline at end of file 30 <?php get_footer(); ?> -
src/wp-content/themes/twentytwelve/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/twentytwelve/search.php
46 46 </section><!-- #primary --> 47 47 48 48 <?php get_sidebar(); ?> 49 <?php get_footer(); ?> 50 No newline at end of file 49 <?php get_footer(); ?> -
src/wp-content/themes/twentytwelve/sidebar-front.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-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) 18 if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) { 19 19 return; 20 } 20 21 21 22 // If we get this far, we have widgets. Let do this. 22 23 ?> … … 32 33 <?php dynamic_sidebar( 'sidebar-3' ); ?> 33 34 </div><!-- .second --> 34 35 <?php endif; ?> 35 </div><!-- #secondary --> 36 No newline at end of file 36 </div><!-- #secondary --> -
src/wp-content/themes/twentytwelve/sidebar.php
14 14 <div id="secondary" class="widget-area" role="complementary"> 15 15 <?php dynamic_sidebar( 'sidebar-1' ); ?> 16 16 </div><!-- #secondary --> 17 <?php endif; ?> 18 No newline at end of file 17 <?php endif; ?> -
src/wp-content/themes/twentytwelve/single.php
30 30 </div><!-- #primary --> 31 31 32 32 <?php get_sidebar(); ?> 33 <?php get_footer(); ?> 34 No newline at end of file 33 <?php get_footer(); ?>