Changeset 26556
- Timestamp:
- 12/03/2013 05:05:53 PM (11 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfourteen
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/archive.php
r26217 r26556 46 46 47 47 <?php 48 while ( have_posts() ) :49 48 // Start the Loop. 49 while ( have_posts() ) : the_post(); 50 50 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 */ 51 56 get_template_part( 'content', get_post_format() ); 57 52 58 endwhile; 59 // Previous/next page navigation. 53 60 twentyfourteen_paging_nav(); 54 61 55 62 else : 63 // If no content, include the "No posts found" template. 56 64 get_template_part( 'content', 'none' ); 57 65 -
trunk/src/wp-content/themes/twentyfourteen/author.php
r25769 r26556 46 46 rewind_posts(); 47 47 48 while ( have_posts() ) :49 48 // Start the Loop. 49 while ( have_posts() ) : the_post(); 50 50 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 */ 51 56 get_template_part( 'content', get_post_format() ); 57 52 58 endwhile; 59 // Previous/next page navigation. 53 60 twentyfourteen_paging_nav(); 54 61 55 62 else : 63 // If no content, include the "No posts found" template. 56 64 get_template_part( 'content', 'none' ); 57 65 -
trunk/src/wp-content/themes/twentyfourteen/category.php
r26217 r26556 30 30 31 31 <?php 32 while ( have_posts() ) :33 32 // Start the Loop. 33 while ( have_posts() ) : the_post(); 34 34 35 get_template_part( 'content', get_post_format() ); 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 36 42 endwhile; 43 // Previous/next page navigation. 37 44 twentyfourteen_paging_nav(); 38 45 39 46 else : 47 // If no content, include the "No posts found" template. 40 48 get_template_part( 'content', 'none' ); 41 49 -
trunk/src/wp-content/themes/twentyfourteen/content-featured-post.php
r26260 r26556 12 12 <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"> 13 13 <?php 14 // Output the featured image. 14 15 if ( has_post_thumbnail() ) : 15 16 if ( 'grid' == get_theme_mod( 'featured_content_layout' ) ) { -
trunk/src/wp-content/themes/twentyfourteen/content-page.php
r25802 r26556 11 11 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 12 12 <?php 13 // Page thumbnail and title. 13 14 twentyfourteen_post_thumbnail(); 14 15 the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); -
trunk/src/wp-content/themes/twentyfourteen/featured-content.php
r26019 r26556 12 12 <div class="featured-content-inner"> 13 13 <?php 14 /** 15 * Fires before the Twenty Fourteen featured content. 16 * 17 * @since Twenty Fourteen 1.0 18 */ 14 19 do_action( 'twentyfourteen_featured_posts_before' ); 15 20 … … 18 23 setup_postdata( $post ); 19 24 25 // Include the featured content template. 20 26 get_template_part( 'content', 'featured-post' ); 21 27 endforeach; 22 28 29 /** 30 * Fires after the Twenty Fourteen featured content. 31 * 32 * @since Twenty Fourteen 1.0 33 */ 23 34 do_action( 'twentyfourteen_featured_posts_after' ); 24 35 -
trunk/src/wp-content/themes/twentyfourteen/functions.php
r26325 r26556 7 7 * hooks in WordPress to change core functionality. 8 8 * 9 * When using a child theme (see http://codex.wordpress.org/Theme_Development 10 * and http://codex.wordpress.org/Child_Themes), you can override certain 11 * functions (those wrapped in a function_exists() call) by defining them first 12 * in your child theme's functions.php file. The child theme's functions.php 13 * file is included before the parent theme's file, so the child theme 14 * functions would be used. 9 * When using a child theme you can override certain functions (those wrapped 10 * in a function_exists() call) by defining them first in your child theme's 11 * functions.php file. The child theme's functions.php file is included before 12 * the parent theme's file, so the child theme functions would be used. 13 * 14 * @link http://codex.wordpress.org/Theme_Development 15 * @link http://codex.wordpress.org/Child_Themes 15 16 * 16 17 * Functions that are not pluggable (not wrapped in function_exists()) are … … 28 29 * Set up the content width value based on the theme's design. 29 30 * 30 * @ linktwentyfourteen_content_width()31 * @see twentyfourteen_content_width() 31 32 * 32 33 * @since Twenty Fourteen 1.0 … … 139 140 */ 140 141 function twentyfourteen_get_featured_posts() { 142 /** 143 * Filter the featured posts to return in Twenty Fourteen. 144 * 145 * @since Twenty Fourteen 1.0 146 * 147 * @param array|bool $posts Array of featured posts, otherwise false. 148 */ 141 149 return apply_filters( 'twentyfourteen_get_featured_posts', array() ); 142 150 } … … 150 158 */ 151 159 function twentyfourteen_has_featured_posts() { 160 /** This filter is documented in functions.php */ 152 161 return ! is_paged() && (bool) apply_filters( 'twentyfourteen_get_featured_posts', false ); 153 162 } 154 163 155 164 /** 156 * Register t wowidget areas.165 * Register three Twenty Fourteen widget areas. 157 166 * 158 167 * @since Twenty Fourteen 1.0 … … 215 224 216 225 /** 217 * Enqueue scripts and styles for front end.226 * Enqueue scripts and styles for the front end. 218 227 * 219 228 * @since Twenty Fourteen 1.0 … … 281 290 function twentyfourteen_the_attached_image() { 282 291 $post = get_post(); 292 /** 293 * Filter the default Twenty Fourteen attachment size. 294 * 295 * @since Twenty Fourteen 1.0 296 * 297 * @param array $dimensions { 298 * An array of height and width dimensions. 299 * 300 * @type int $height Height of the image in pixels. Default 1200. 301 * @type int $width Width of the image in pixels. Default 1200. 302 * } 303 */ 283 304 $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 1200, 1200 ) ); 284 305 $next_attachment_url = wp_get_attachment_url(); -
trunk/src/wp-content/themes/twentyfourteen/image.php
r26227 r26556 8 8 */ 9 9 10 // Retrieve attachment metadata. 10 11 $metadata = wp_get_attachment_metadata(); 11 12 … … 16 17 <div id="content" class="site-content" role="main"> 17 18 18 <?php while ( have_posts() ) : the_post(); ?> 19 19 <?php 20 // Start the Loop. 21 while ( have_posts() ) : the_post(); 22 ?> 20 23 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 21 24 <header class="entry-header"> -
trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php
r25769 r26556 18 18 */ 19 19 function twentyfourteen_custom_header_setup() { 20 /** 21 * Filter Twenty Fourteen custom-header support arguments. 22 * 23 * @since Twenty Fourteen 1.0 24 * 25 * @param array $args { 26 * An array of custom-header support arguments. 27 * 28 * @type bool $header_text Whether to display custom header text. Default false. 29 * @type int $width Width in pixels of the custom header image. Default 1260. 30 * @type int $height Height in pixels of the custom header image. Default 240. 31 * @type bool $flex_height Whether to allow flexible-height header images. Default true. 32 * @type string $admin_head_callback Callback function used to style the image displayed in 33 * the Appearance > Header screen. 34 * @type string $admin_preview_callback Callback function used to create the custom header markup in 35 * the Appearance > Header screen. 36 * } 37 */ 20 38 add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( 21 39 'header-text' => false, … … 31 49 if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : 32 50 /** 33 * Style the header image displayed on the Appearance > Header admin panel.51 * Style the header image displayed on the Appearance > Header screen. 34 52 * 35 * @ link twentyfourteen_custom_header_setup().53 * @see twentyfourteen_custom_header_setup() 36 54 * 37 55 * @since Twenty Fourteen 1.0 … … 66 84 if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : 67 85 /** 68 * Create the custom header image markup displayed on the Appearance > Header admin panel.86 * Create the custom header image markup displayed on the Appearance > Header screen. 69 87 * 70 * @ link twentyfourteen_custom_header_setup().88 * @see twentyfourteen_custom_header_setup() 71 89 * 72 90 * @since Twenty Fourteen 1.0 -
trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php
r26555 r26556 73 73 74 74 /** 75 * Tweak the brightness of a color by adjusting the RGB values by the given interval. 76 * 77 * Use positive values of $steps to brighten the color and negative values to darken the color. 78 * All three RGB values are modified by the specified steps, within the range of 0-255. The hue 79 * is generally maintained unless the number of steps causes one value to be capped at 0 or 255. 75 * Tweak the brightness of a color by adjusting the RGB 76 * values by the given interval. 77 * 78 * Use positive values of $steps to brighten the color and negative 79 * values to darken the color. All three RGB values are modified by 80 * the specified steps, within the range of 0-255. The hue is generally 81 * maintained unless the number of steps causes one value to be capped 82 * at 0 or 255. 80 83 * 81 84 * @since Twenty Fourteen 1.0 82 85 * 83 86 * @param string $color The original color, in 3- or 6-digit hexadecimal form. 84 * @param int $steps The number of steps to adjust the color by, in RGB units.87 * @param int $steps The number of steps to adjust the color by, in RGB units. 85 88 * @return string $color The new color, in 6-digit hexadecimal form. 86 89 */ … … 110 113 111 114 /** 112 * Return sa slightly lighter color than what is set as the theme's115 * Return a slightly lighter color than what is set as the theme's 113 116 * accent color. 114 117 * 115 118 * @since Twenty Fourteen 1.0 116 119 * 117 * @return string 120 * @return string Hex color. 118 121 */ 119 122 function twentyfourteen_accent_mid() { … … 122 125 123 126 /** 124 * Return sa lighter color than what is set as the theme's accent color.125 * 126 * @since Twenty Fourteen 1.0 127 * 128 * @return string 127 * Return a lighter color than what is set as the theme's accent color. 128 * 129 * @since Twenty Fourteen 1.0 130 * 131 * @return string Hex color. 129 132 */ 130 133 function twentyfourteen_accent_light() { … … 133 136 134 137 /** 135 * Cache sthe generated variants of the theme's accent color.138 * Cache the generated variants of the theme's accent color. 136 139 * 137 140 * @since Twenty Fourteen 1.0 … … 325 328 326 329 /** 327 * Add scontextual help to the Themes and Post edit screens.330 * Add contextual help to the Themes and Post edit screens. 328 331 * 329 332 * @since Twenty Fourteen 1.0 -
trunk/src/wp-content/themes/twentyfourteen/inc/featured-content.php
r26361 r26556 3 3 * Twenty Fourteen Featured Content 4 4 * 5 * This module allows you to define a subset of posts to be displayed in the6 * theme's Featured Content area.5 * This module allows you to define a subset of posts to be displayed 6 * in the theme's Featured Content area. 7 7 * 8 * For maximum compatibility with different methods of posting users will9 * designate a featured post tag to associate posts with. Since this tag now10 * has special meaning beyond that of a normal tags, users will have the11 * ability to hide it from the front-end of their site.8 * For maximum compatibility with different methods of posting users 9 * will designate a featured post tag to associate posts with. Since 10 * this tag now has special meaning beyond that of a normal tags, users 11 * will have the ability to hide it from the front-end of their site. 12 12 */ 13 13 class Featured_Content { 14 14 15 15 /** 16 * The maximum number of posts that a Featured Content area can contain. We 17 * define a default value here but themes can override this by defining a 18 * "max_posts" entry in the second parameter passed in the call to 19 * add_theme_support( 'featured-content' ). 16 * The maximum number of posts a Featured Content area can contain. 17 * 18 * We define a default value here but themes can override 19 * this by defining a "max_posts" entry in the second parameter 20 * passed in the call to add_theme_support( 'featured-content' ). 20 21 * 21 22 * @see Featured_Content::init() 23 * 24 * @since Twenty Fourteen 1.0 25 * 26 * @static 27 * @access public 28 * @var int 22 29 */ 23 30 public static $max_posts = 15; 24 31 25 32 /** 26 * Instantiate 33 * Instantiate. 27 34 * 28 35 * All custom functionality will be hooked into the "init" action. 36 * 37 * @static 38 * @access public 39 * @since Twenty Fourteen 1.0 29 40 */ 30 41 public static function setup() { … … 33 44 34 45 /** 35 * Conditionally hook into WordPress 46 * Conditionally hook into WordPress. 36 47 * 37 48 * Theme must declare that they support this module by adding … … 41 52 * We'll just return early instead. 42 53 * 43 * @uses Featured_Content::$max_posts 54 * @static 55 * @access public 56 * @since Twenty Fourteen 1.0 44 57 */ 45 58 public static function init() { … … 86 99 * Has to run on wp_loaded so that the preview filters of the customizer 87 100 * have a chance to alter the value. 101 * 102 * @static 103 * @access public 104 * @since Twenty Fourteen 1.0 88 105 */ 89 106 public static function wp_loaded() { … … 95 112 96 113 /** 97 * Get featured posts 98 * 99 * @uses Featured_Content::get_featured_post_ids() 100 * 101 * @return array 114 * Get featured posts. 115 * 116 * @static 117 * @access public 118 * @since Twenty Fourteen 1.0 119 * 120 * @return array Array of featured posts. 102 121 */ 103 122 public static function get_featured_posts() { … … 125 144 * Sets the "featured_content_ids" transient. 126 145 * 127 * @return array Array of post IDs 146 * @static 147 * @access public 148 * @since Twenty Fourteen 1.0 149 * 150 * @return array Array of post IDs. 128 151 */ 129 152 public static function get_featured_post_ids() { … … 171 194 172 195 /** 173 * Returns an array with IDs of posts maked as sticky. 174 * 175 * @return array 196 * Return an array with IDs of posts maked as sticky. 197 * 198 * @static 199 * @access public 200 * @since Twenty Fourteen 1.0 201 * 202 * @return array Array of sticky posts. 176 203 */ 177 204 public static function get_sticky_posts() { … … 181 208 182 209 /** 183 * Delete transient210 * Delete featured content ids transient. 184 211 * 185 212 * Hooks in the "save_post" action. 213 * 186 214 * @see Featured_Content::validate_settings(). 215 * 216 * @static 217 * @access public 218 * @since Twenty Fourteen 1.0 187 219 */ 188 220 public static function delete_transient() { … … 191 223 192 224 /** 193 * Exclude featured posts from the home page blog query 194 * 195 * Filter the home page posts, and remove any featured post ID's from it. Hooked 196 * onto the 'pre_get_posts' action, this changes the parameters of the query 197 * before it gets any posts. 198 * 199 * @uses Featured_Content::get_featured_post_ids(); 200 * @param WP_Query $query 201 * @return WP_Query Possibly modified WP_Query 225 * Exclude featured posts from the home page blog query. 226 * 227 * Filter the home page posts, and remove any featured post ID's from it. 228 * Hooked onto the 'pre_get_posts' action, this changes the parameters of 229 * the query before it gets any posts. 230 * 231 * @static 232 * @access public 233 * @since Twenty Fourteen 1.0 234 * 235 * @param WP_Query $query WP_Query object. 236 * @return WP_Query Possibly-modified WP_Query. 202 237 */ 203 238 public static function pre_get_posts( $query ) { … … 234 269 235 270 /** 236 * Reset tag option when the saved tag is deleted 237 * 238 * It's important to mention that the transient needs to be deleted, too.239 * While it may not be obvious by looking at the function alone, the transient240 * is deleted by Featured_Content::validate_settings().271 * Reset tag option when the saved tag is deleted. 272 * 273 * It's important to mention that the transient needs to be deleted, 274 * too. While it may not be obvious by looking at the function alone, 275 * the transient is deleted by Featured_Content::validate_settings(). 241 276 * 242 277 * Hooks in the "delete_post_tag" action. 278 * 243 279 * @see Featured_Content::validate_settings(). 280 * 281 * @static 282 * @access public 283 * @since Twenty Fourteen 1.0 244 284 * 245 285 * @param int $tag_id The term_id of the tag that has been deleted. … … 259 299 260 300 /** 261 * Hide featured tag from displaying when global terms are queried from the front-end 301 * Hide featured tag from displaying when global terms are queried from the front-end. 262 302 * 263 303 * Hooks into the "get_terms" filter. 264 304 * 265 * @param array $terms A list of term objects. This is the return value of get_terms(). 305 * @static 306 * @access public 307 * @since Twenty Fourteen 1.0 308 * 309 * @param array $terms List of term objects. This is the return value of get_terms(). 266 310 * @param array $taxonomies An array of taxonomy slugs. 267 * @return array $terms311 * @return array A filtered array of terms. 268 312 * 269 313 * @uses Featured_Content::get_setting() … … 296 340 297 341 /** 298 * Hide featured tag from display when terms associated with a post object are queried from the front-end 342 * Hide featured tag from display when terms associated with a post object 343 * are queried from the front-end. 299 344 * 300 345 * Hooks into the "get_the_terms" filter. 301 346 * 302 * @param array $terms A list of term objects. This is the return value of get_the_terms(). 303 * @param int $id The ID field for the post object that terms are associated with. 347 * @static 348 * @access public 349 * @since Twenty Fourteen 1.0 350 * 351 * @param array $terms A list of term objects. This is the return value of get_the_terms(). 352 * @param int $id The ID field for the post object that terms are associated with. 304 353 * @param array $taxonomy An array of taxonomy slugs. 305 * @return array $terms354 * @return array Filtered array of terms. 306 355 * 307 356 * @uses Featured_Content::get_setting() … … 334 383 335 384 /** 336 * Register custom setting on the Settings -> Reading screen 337 * 338 * @uses Featured_Content::render_form() 339 * @uses Featured_Content::validate_settings() 385 * Register custom setting on the Settings -> Reading screen. 386 * 387 * @static 388 * @access public 389 * @since Twenty Fourteen 1.0 340 390 * 341 391 * @return void … … 347 397 /** 348 398 * Add settings to the Customizer. 399 * 400 * @static 401 * @access public 402 * @since Twenty Fourteen 1.0 349 403 * 350 404 * @param WP_Customize_Manager $wp_customize Theme Customizer object. … … 387 441 * Enqueue the tag suggestion script. 388 442 * 443 * @static 444 * @access public 389 445 * @since Twenty Fourteen 1.0 390 446 */ … … 394 450 395 451 /** 396 * Get settings 397 * 398 * Get all settings recognized by this module. This function will return 399 * all settings whether or not they have been stored in the database yet. 400 * This ensures that all keys are available at all times. 401 * 402 * In the event that you only require one setting, you may pass its name 403 * as the first parameter to the function and only that value will be returned. 404 * 405 * @uses Featured_Content::sanitize_quantity() 452 * Get featured content settings. 453 * 454 * Get all settings recognized by this module. This function 455 * will return all settings whether or not they have been stored 456 * in the database yet. This ensures that all keys are available 457 * at all times. 458 * 459 * In the event that you only require one setting, you may pass 460 * its name as the first parameter to the function and only that 461 * value will be returned. 462 * 463 * @static 464 * @access public 465 * @since Twenty Fourteen 1.0 406 466 * 407 467 * @param string $key The key of a recognized setting. … … 430 490 431 491 /** 432 * Validate settings433 * 434 * Make sure that all user supplied content is in an 435 * expected format before saving to the database. This436 * function will also delete the transient set in437 * Featured_Content::get_featured_content().438 * 439 * @ uses Featured_Content::self::sanitize_quantity()440 * @ uses Featured_Content::self::delete_transient()441 * 442 * @param array $input 443 * @return array $output492 * Validate featured content settings. 493 * 494 * Make sure that all user supplied content is in an expected 495 * format before saving to the database. This function will also 496 * delete the transient set in Featured_Content::get_featured_content(). 497 * 498 * @static 499 * @access public 500 * @since Twenty Fourteen 1.0 501 * 502 * @param array $input Array of settings input. 503 * @return array Validated settings output. 444 504 */ 445 505 public static function validate_settings( $input ) { … … 470 530 $output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0; 471 531 532 // Delete the featured post ids transient. 472 533 self::delete_transient(); 473 534 … … 476 537 477 538 /** 478 * Sanitize quantity 539 * Sanitize quantity of featured posts. 540 * 541 * @static 542 * @access public 543 * @since Twenty Fourteen 1.0 479 544 * 480 545 * @param int $input The value to sanitize. 481 546 * @return int A number between 1 and FeaturedContent::$max_posts. 482 *483 * @uses Featured_Content::$max_posts484 547 */ 485 548 public static function sanitize_quantity( $input ) { … … 494 557 return $quantity; 495 558 } 496 } 559 560 } // Featured_Content 497 561 498 562 Featured_Content::setup(); -
trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php
r26260 r26556 37 37 $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; 38 38 39 $links = paginate_links( array( 39 // Set up paginated links. 40 $links = paginate_links( array( 40 41 'base' => $pagenum_link, 41 42 'format' => $format, … … 110 111 } 111 112 113 // Set up and print post meta information. 112 114 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>', 'twentyfourteen' ), 113 115 esc_url( get_permalink() ), … … 150 152 151 153 /** 152 * Flush out the transients used in twentyfourteen_categorized_blog 154 * Flush out the transients used in twentyfourteen_categorized_blog. 153 155 * 154 156 * @since Twenty Fourteen 1.0 … … 164 166 165 167 /** 166 * Displays an optional post thumbnail, with an anchor element 167 * when on index views, and a div element when on a single view. 168 * Display an optional post thumbnail on a single view. 169 * 170 * Adds an anchor element to the post thumbnail, when on 171 * index views, and a div element when on a single view. 168 172 * 169 173 * @since Twenty Fourteen 1.0 -
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r26355 r26556 17 17 * The supported post formats. 18 18 * 19 * @access private 19 20 * @since Twenty Fourteen 1.0 20 21 * … … 26 27 * Pluralized post format strings. 27 28 * 29 * @access private 28 30 * @since Twenty Fourteen 1.0 29 31 * … … 66 68 * Output the HTML for this widget. 67 69 * 68 * @since Twenty Fourteen 1.0 69 * 70 * @param array $args An array of standard parameters for widgets in this theme. 70 * @access public 71 * @since Twenty Fourteen 1.0 72 * 73 * @param array $args An array of standard parameters for widgets in this theme. 71 74 * @param array $instance An array of settings for this widget instance. 72 75 * @return void Echoes its output. … … 220 223 221 224 /** 222 * Deal with the settings when they are saved by the admin. Here is where 223 * any validation should happen. 224 * 225 * @since Twenty Fourteen 1.0 226 * 227 * @param array $new_instance 228 * @param array $instance 229 * @return array 225 * Deal with the settings when they are saved by the admin. 226 * 227 * Here is where any validation should happen. 228 * 229 * @since Twenty Fourteen 1.0 230 * 231 * @param array $new_instance New widget instance. 232 * @param array $instance Original widget instance. 233 * @return array Updated widget instance. 230 234 */ 231 235 function update( $new_instance, $instance ) { -
trunk/src/wp-content/themes/twentyfourteen/index.php
r26260 r26556 3 3 * The main template file 4 4 * 5 * This is the most generic template file in a WordPress theme 6 * and one of the two required files for a theme (the other being style.css). 7 * It is used to display a page when nothing more specific matches a query. 8 * E.g., it puts together the home page when no home.php file exists. 5 * This is the most generic template file in a WordPress theme and one 6 * of the two required files for a theme (the other being style.css). 7 * It is used to display a page when nothing more specific matches a query, 8 * e.g., it puts together the home page when no home.php file exists. 9 * 9 10 * @link http://codex.wordpress.org/Template_Hierarchy 10 11 * … … 19 20 20 21 <?php 21 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 22 if ( is_front_page() && twentyfourteen_has_featured_posts() ) : 23 // Include the featured content template. 22 24 get_template_part( 'featured-content' ); 23 }25 endif; 24 26 ?> 25 27 … … 29 31 <?php 30 32 if ( have_posts() ) : 31 while ( have_posts() ) :32 33 // Start the Loop. 34 while ( have_posts() ) : the_post(); 33 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 */ 34 41 get_template_part( 'content', get_post_format() ); 42 35 43 endwhile; 44 // Previous/next post navigation. 36 45 twentyfourteen_paging_nav(); 37 46 38 47 else : 48 // If no content, include the "No posts found" template. 39 49 get_template_part( 'content', 'none' ); 40 50 -
trunk/src/wp-content/themes/twentyfourteen/page-templates/contributors.php
r26260 r26556 14 14 <?php 15 15 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 16 // Include the featured content template. 16 17 get_template_part( 'featured-content' ); 17 18 } … … 21 22 <div id="content" class="site-content" role="main"> 22 23 <?php 23 while ( have_posts() ) :24 24 // Start the Loop. 25 while ( have_posts() ) : the_post(); 25 26 ?> 26 27 … … 29 30 the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); 30 31 32 // Output the authors list. 31 33 twentyfourteen_list_authors(); 32 34 -
trunk/src/wp-content/themes/twentyfourteen/page-templates/full-width.php
r26260 r26556 14 14 <?php 15 15 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 16 // Include the featured content template. 16 17 get_template_part( 'featured-content' ); 17 18 } … … 21 22 <div id="content" class="site-content" role="main"> 22 23 <?php 23 while ( have_posts() ) :24 24 // Start the Loop. 25 while ( have_posts() ) : the_post(); 25 26 27 // Include the page content template. 26 28 get_template_part( 'content', 'page' ); 27 29 -
trunk/src/wp-content/themes/twentyfourteen/page.php
r26260 r26556 4 4 * 5 5 * This is the template that displays all pages by default. 6 * Please note that this is the WordPress construct of pages and that other 'pages'7 * o n your WordPress site will use a different template.6 * Please note that this is the WordPress construct of pages and that 7 * other 'pages' on your WordPress site will use a different template. 8 8 * 9 9 * @package WordPress … … 17 17 18 18 <?php 19 if ( is_front_page() && twentyfourteen_has_featured_posts() ) { 19 if ( is_front_page() && twentyfourteen_has_featured_posts() ) :\ 20 // Include the featured content template. 20 21 get_template_part( 'featured-content' ); 21 }22 endif; 22 23 ?> 23 24 <div id="primary" class="content-area"> … … 25 26 26 27 <?php 27 while ( have_posts() ) :28 28 // Start the Loop. 29 while ( have_posts() ) : the_post(); 29 30 31 // Include the page content template. 30 32 get_template_part( 'content', 'page' ); 31 33 32 34 // If comments are open or we have at least one comment, load up the comment template. 33 if ( comments_open() || get_comments_number() ) {35 if ( comments_open() || get_comments_number() ) : 34 36 comments_template(); 35 }37 endif; 36 38 endwhile; 37 39 ?> -
trunk/src/wp-content/themes/twentyfourteen/search.php
r26227 r26556 19 19 </header><!-- .page-header --> 20 20 21 <?php22 while ( have_posts() ) :23 21 <?php 22 // Start the Loop. 23 while ( have_posts() ) : the_post(); 24 24 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 */ 25 30 get_template_part( 'content', get_post_format() ); 31 26 32 endwhile; 33 // Previous/next post navigation. 27 34 twentyfourteen_paging_nav(); 28 35 29 36 else : 37 // If no content, include the "No posts found" template. 30 38 get_template_part( 'content', 'none' ); 31 39 -
trunk/src/wp-content/themes/twentyfourteen/single.php
r26260 r26556 13 13 <div id="content" class="site-content" role="main"> 14 14 <?php 15 while ( have_posts() ) :16 15 // Start the Loop. 16 while ( have_posts() ) : the_post(); 17 17 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 */ 18 23 get_template_part( 'content', get_post_format() ); 19 24 25 // Previous/next post navigation. 20 26 twentyfourteen_post_nav(); 21 27 -
trunk/src/wp-content/themes/twentyfourteen/tag.php
r26217 r26556 32 32 33 33 <?php 34 while ( have_posts() ) :35 34 // Start the Loop. 35 while ( have_posts() ) : the_post(); 36 36 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 */ 37 42 get_template_part( 'content', get_post_format() ); 43 38 44 endwhile; 45 // Previous/next page navigation. 39 46 twentyfourteen_paging_nav(); 40 47 41 48 else : 49 // If no content, include the "No posts found" template. 42 50 get_template_part( 'content', 'none' ); 43 51 -
trunk/src/wp-content/themes/twentyfourteen/taxonomy-post_format.php
r26217 r26556 54 54 55 55 <?php 56 while ( have_posts() ) :57 56 // Start the Loop. 57 while ( have_posts() ) : the_post(); 58 58 59 /* 60 * Include the post format-specific template for the content. If you want to 61 * use this in a child theme, then include a file called called content-___.php 62 * (where ___ is the post format) and that will be used instead. 63 */ 59 64 get_template_part( 'content', get_post_format() ); 65 60 66 endwhile; 67 // Previous/next page navigation. 61 68 twentyfourteen_paging_nav(); 62 69 63 70 else : 71 // If no content, include the "No posts found" template. 64 72 get_template_part( 'content', 'none' ); 65 73
Note: See TracChangeset
for help on using the changeset viewer.