Ticket #25256: twentyeleven.diff
File twentyeleven.diff, 48.1 KB (added by , 12 years ago) |
---|
-
src/wp-content/themes/twentyeleven/404.php
1 1 <?php 2 2 /** 3 * T he template for displaying 404 pages (Not Found).3 * Template for displaying 404 pages (Not Found) 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/archive.php
1 1 <?php 2 2 /** 3 * T he template for displaying Archive pages.3 * Template for displaying Archive pages 4 4 * 5 5 * Used to display archive-type pages if nothing more specific matches a query. 6 6 * For example, puts together date-based pages if no date.php file exists. 7 7 * 8 * Learn more:http://codex.wordpress.org/Template_Hierarchy8 * @link http://codex.wordpress.org/Template_Hierarchy 9 9 * 10 10 * @package WordPress 11 11 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/author.php
1 1 <?php 2 2 /** 3 * T he template for displaying Author Archive pages.3 * Template for displaying Author Archive pages 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 15 15 <?php if ( have_posts() ) : ?> 16 16 17 17 <?php 18 /* Queue the first post, that way we know 19 * what author we're dealing with (if that is the case). 18 /** 19 * Queue the first post, that way we know what author 20 * we're dealing with (if that is the case). 20 21 * 21 * We reset this later so we can run the loop 22 * properlywith a call to rewind_posts().22 * We reset this later so we can run the loop properly 23 * with a call to rewind_posts(). 23 24 */ 24 25 the_post(); 25 26 ?> … … 29 30 </header> 30 31 31 32 <?php 32 /* Since we called the_post() above, we need to 33 /** 34 * Since we called the_post() above, we need to 33 35 * rewind the loop back to the beginning that way 34 36 * we can run the loop properly, in full. 35 37 */ … … 43 45 if ( get_the_author_meta( 'description' ) ) : ?> 44 46 <div id="author-info"> 45 47 <div id="author-avatar"> 46 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?> 48 <?php 49 /** 50 * Filter the Twenty Eleven author bio avatar size. 51 * 52 * @since Twenty Eleven 1.0 53 * 54 * @param int The height and width avatar dimension in pixels. Default 60. 55 */ 56 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); 57 ?> 47 58 </div><!-- #author-avatar --> 48 59 <div id="author-description"> 49 60 <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2> … … 56 67 <?php while ( have_posts() ) : the_post(); ?> 57 68 58 69 <?php 59 /* Include the Post-Format-specific template for the content. 70 /** 71 * Include the Post-Format-specific template for the content. 60 72 * If you want to overload this in a child theme then include a file 61 73 * called content-___.php (where ___ is the Post Format name) and that will be used instead. 62 74 */ -
src/wp-content/themes/twentyeleven/category.php
1 1 <?php 2 2 /** 3 * T he template for displaying Category Archive pages.3 * Template for displaying Category Archive pages 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 21 21 22 22 <?php 23 23 $category_description = category_description(); 24 if ( ! empty( $category_description ) ) 24 if ( ! empty( $category_description ) ) { 25 /** 26 * Filter the default Twenty Eleven category description. 27 * 28 * @since Twenty Eleven 1.0 29 * 30 * @param string The default category description HTML. 31 */ 25 32 echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' ); 33 } 26 34 ?> 27 35 </header> 28 36 … … 32 40 <?php while ( have_posts() ) : the_post(); ?> 33 41 34 42 <?php 35 /* Include the Post-Format-specific template for the content. 43 /** 44 * Include the Post-Format-specific template for the content. 36 45 * If you want to overload this in a child theme then include a file 37 46 * called content-___.php (where ___ is the Post Format name) and that will be used instead. 38 47 */ -
src/wp-content/themes/twentyeleven/comments.php
1 1 <?php 2 2 /** 3 * T he template for displaying Comments.3 * Template for displaying Comments 4 4 * 5 5 * The area of the page that contains both current comments 6 6 * and the comment form. The actual display of comments is … … 17 17 <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p> 18 18 </div><!-- #comments --> 19 19 <?php 20 /* Stop the rest of comments.php from being processed, 20 /** 21 * Stop the rest of comments.php from being processed, 21 22 * but don't kill the script entirely -- we still have 22 23 * to fully load the template. 23 24 */ … … 45 46 46 47 <ol class="commentlist"> 47 48 <?php 48 /* Loop through and list the comments. Tell wp_list_comments() 49 /** 50 * Loop through and list the comments. Tell wp_list_comments() 49 51 * to use twentyeleven_comment() to format the comments. 50 52 * If you want to overload this in a child theme then you can 51 53 * define twentyeleven_comment() and that will be used instead. … … 64 66 <?php endif; // check for comment navigation ?> 65 67 66 68 <?php 67 /* If there are no comments and comments are closed, let's leave a little note, shall we? 69 /** 70 * If there are no comments and comments are closed, let's leave a little note, shall we? 68 71 * But we only want the note on posts and pages that had comments in the first place. 69 72 */ 70 73 if ( ! comments_open() && get_comments_number() ) : ?> -
src/wp-content/themes/twentyeleven/content-aside.php
1 1 <?php 2 2 /** 3 * T he template for displaying posts in the Aside Post Format on index and archive pages3 * Template for displaying posts in the Aside Post Format 4 4 * 5 * Learn more: http://codex.wordpress.org/Post_Formats5 * Used on index and archive pages. 6 6 * 7 * @link http://codex.wordpress.org/Post_Formats 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 9 11 * @since Twenty Eleven 1.0 -
src/wp-content/themes/twentyeleven/content-featured.php
1 1 <?php 2 2 /** 3 * T he template for displaying content featured in the showcase.php page template3 * Template for displaying content featured in the showcase.php page template 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/content-gallery.php
1 1 <?php 2 2 /** 3 * T he template for displaying posts in the Gallery Post Format on index and archive pages3 * Template for displaying posts in the Gallery Post Format 4 4 * 5 * Learn more: http://codex.wordpress.org/Post_Formats5 * Used on index and archive pages. 6 6 * 7 * @link http://codex.wordpress.org/Post_Formats 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 9 11 * @since Twenty Eleven 1.0 -
src/wp-content/themes/twentyeleven/content-image.php
1 1 <?php 2 2 /** 3 * T he template for displaying posts in the Image Post Format on index and archive pages3 * Template for displaying posts in the Image Post Format 4 4 * 5 * Learn more: http://codex.wordpress.org/Post_Formats5 * Used on index and archive pages. 6 6 * 7 * @link http://codex.wordpress.org/Post_Formats 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 9 11 * @since Twenty Eleven 1.0 -
src/wp-content/themes/twentyeleven/content-intro.php
1 1 <?php 2 2 /** 3 * T he template for displaying page content in the showcase.php page template3 * Template for displaying page content in the showcase.php page template 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/content-link.php
1 1 <?php 2 2 /** 3 * T he template for displaying posts in the Link Post Format on index and archive pages3 * Template for displaying posts in the Link Post Format 4 4 * 5 * Learn more: http://codex.wordpress.org/Post_Formats5 * Used on index and archive pages 6 6 * 7 * @link http://codex.wordpress.org/Post_Formats 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 9 11 * @since Twenty Eleven 1.0 -
src/wp-content/themes/twentyeleven/content-page.php
1 1 <?php 2 2 /** 3 * T he template used for displaying page content in page.php3 * Template used for displaying page content in page.php 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/content-quote.php
1 1 <?php 2 2 /** 3 * T he default template for displaying content3 * Template for displaying content 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/content-single.php
54 54 <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> 55 55 <div id="author-info"> 56 56 <div id="author-avatar"> 57 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?> 57 <?php 58 //duplicate_hook 59 echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); 60 ?> 58 61 </div><!-- #author-avatar --> 59 62 <div id="author-description"> 60 63 <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2> -
src/wp-content/themes/twentyeleven/content-status.php
1 1 <?php 2 2 /** 3 * T he template for displaying posts in the Status Post Format on index and archive pages3 * Template for displaying posts in the Status Post Format 4 4 * 5 * Learn more: http://codex.wordpress.org/Post_Formats5 * Used on index and archive pages 6 6 * 7 * @link http://codex.wordpress.org/Post_Formats 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 11 * @since Twenty Eleven 1.0 9 12 */ 10 13 ?> 11 14 … … 29 32 </div><!-- .entry-summary --> 30 33 <?php else : ?> 31 34 <div class="entry-content"> 32 <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div> 35 <div class="avatar"> 36 <?php 37 /** 38 * Filter the Twenty Eleven status avatar size. 39 * 40 * @since Twenty Eleven 1.0 41 * 42 * @param int The height and width avatar dimensions in pixels. Default 65. 43 */ 44 echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', 65 ) ); 45 ?> 46 </div> 33 47 34 48 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> 35 49 <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> -
src/wp-content/themes/twentyeleven/content.php
1 1 <?php 2 2 /** 3 * T he default template for displaying content3 * Template for displaying content 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/footer.php
1 1 <?php 2 2 /** 3 * T he template for displaying the footer.3 * Template for displaying the footer 4 4 * 5 5 * Contains the closing of the id=main div and all content after 6 6 * … … 15 15 <footer id="colophon" role="contentinfo"> 16 16 17 17 <?php 18 /* A sidebar in the footer? Yep. You can can customize 18 /** 19 * A sidebar in the footer? Yep. You can can customize 19 20 * your footer with three columns of widgets. 20 21 */ 21 22 if ( ! is_404() ) -
src/wp-content/themes/twentyeleven/functions.php
51 51 52 52 if ( ! function_exists( 'twentyeleven_setup' ) ): 53 53 /** 54 * Set sup theme defaults and registers support for various WordPress features.54 * Set up theme defaults and registers support for various WordPress features. 55 55 * 56 56 * Note that this function is hooked into the after_setup_theme hook, which runs 57 57 * before the init hook. The init hook is too late for some features, such as indicating … … 60 60 * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's 61 61 * functions.php file. 62 62 * 63 * @uses load_theme_textdomain() For translation/localization support.64 * @uses add_editor_style() To style the visual editor.65 * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers66 * and backgrounds, and post formats.67 * @uses register_nav_menus() To add support for navigation menus.63 * @uses load_theme_textdomain() For translation/localization support. 64 * @uses add_editor_style() To style the visual editor. 65 * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers 66 * and backgrounds, and post formats. 67 * @uses register_nav_menus() To add support for navigation menus. 68 68 * @uses register_default_headers() To register the default custom header images provided with the theme. 69 * @uses set_post_thumbnail_size() To set a custom post thumbnail size.69 * @uses set_post_thumbnail_size() To set a custom post thumbnail size. 70 70 * 71 71 * @since Twenty Eleven 1.0 72 72 */ 73 73 function twentyeleven_setup() { 74 74 75 /* Make Twenty Eleven available for translation. 75 /** 76 * Make Twenty Eleven available for translation. 76 77 * Translations can be added to the /languages/ directory. 77 * If you're building a theme based on Twenty Eleven, use a find and replace 78 * to change 'twentyeleven' to the name of your theme in all the template files. 78 * If you're building a theme based on Twenty Eleven, use 79 * a find and replace to change 'twentyeleven' to the name 80 * of your theme in all the template files. 79 81 */ 80 82 load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' ); 81 83 … … 105 107 106 108 // Add support for custom backgrounds. 107 109 add_theme_support( 'custom-background', array( 108 // Let WordPress know what our default background color is. 109 // This is dependent on our current color scheme. 110 /** 111 * Let WordPress know what our default background color is. 112 * This is dependent on our current color scheme. 113 */ 110 114 'default-color' => $default_background_color, 111 115 ) ); 112 116 … … 118 122 // The default header text color. 119 123 'default-text-color' => '000', 120 124 // The height and width of our custom header. 125 /** 126 * Filter the Twenty Eleven default header image width. 127 * 128 * @since Twenty Eleven 1.0 129 * 130 * @param int The default header image width in pixels. Default 1000. 131 */ 121 132 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ), 133 /** 134 * Filter the Twenty Eleven default header image height. 135 * 136 * @since Twenty Eleven 1.0 137 * 138 * @param int The default header image height in pixels. Default 288. 139 */ 122 140 'height' => apply_filters( 'twentyeleven_header_image_height', 288 ), 123 141 // Support flexible heights. 124 142 'flex-height' => true, … … 144 162 add_custom_background(); 145 163 } 146 164 147 // We'll be using post thumbnails for custom header images on posts and pages. 148 // We want them to be the size of the header image that we just defined 149 // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 165 /** 166 * We'll be using post thumbnails for custom header images on posts and pages. 167 * We want them to be the size of the header image that we just defined. 168 * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. 169 */ 150 170 set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true ); 151 171 152 // Add Twenty Eleven's custom image sizes. 153 // Used for large feature (header) images. 172 /** 173 * Add Twenty Eleven's custom image sizes. 174 * Used for large feature (header) images. 175 */ 154 176 add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true ); 155 177 // Used for featured posts if a large-feature doesn't exist. 156 178 add_image_size( 'small-feature', 500, 300 ); … … 211 233 212 234 if ( ! function_exists( 'twentyeleven_header_style' ) ) : 213 235 /** 214 * Styles the header image and text displayed on the blog 236 * Styles the header image and text displayed on the blog. 215 237 * 216 238 * @since Twenty Eleven 1.0 217 239 */ … … 327 349 endif; // twentyeleven_admin_header_image 328 350 329 351 /** 330 * Set sthe post excerpt length to 40 words.352 * Set the post excerpt length to 40 words. 331 353 * 332 * To override this length in a child theme, remove the filter and add your own 333 * function tied to the excerpt_length filter hook. 354 * To override this length in a child theme, remove 355 * the filter and add your own function tied to 356 * the excerpt_length filter hook. 357 * 358 * @since Twenty Eleven 1.0 359 * 360 * @param int $length The number of excerpt characters. 361 * @return int The filtered number of characters. 334 362 */ 335 363 function twentyeleven_excerpt_length( $length ) { 336 364 return 40; … … 339 367 340 368 if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) : 341 369 /** 342 * Returns a "Continue Reading" link for excerpts 370 * Return a "Continue Reading" link for excerpts 371 * 372 * @since Twenty Eleven 1.0 373 * 374 * @return string The "Continue Reading" HTML link. 343 375 */ 344 376 function twentyeleven_continue_reading_link() { 345 377 return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>'; … … 347 379 endif; // twentyeleven_continue_reading_link 348 380 349 381 /** 350 * Replace s "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().382 * Replace "[...]" in the Read More link with an ellipsis. 351 383 * 384 * The "[...]" is appended to automatically generated excerpts. 385 * 352 386 * To override this in a child theme, remove the filter and add your own 353 387 * function tied to the excerpt_more filter hook. 388 * 389 * @since Twenty Eleven 1.0 390 * 391 * @param string $more The Read More text. 392 * @return The filtered Read More text. 354 393 */ 355 394 function twentyeleven_auto_excerpt_more( $more ) { 356 395 return ' …' . twentyeleven_continue_reading_link(); … … 358 397 add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' ); 359 398 360 399 /** 361 * Add sa pretty "Continue Reading" link to custom post excerpts.400 * Add a pretty "Continue Reading" link to custom post excerpts. 362 401 * 363 402 * To override this link in a child theme, remove the filter and add your own 364 403 * function tied to the get_the_excerpt filter hook. 404 * 405 * @since Twenty Eleven 1.0 406 * 407 * @param string $output The "Continue Reading" link. 408 * @return string The filtered "Continue Reading" link. 365 409 */ 366 410 function twentyeleven_custom_excerpt_more( $output ) { 367 411 if ( has_excerpt() && ! is_attachment() ) { … … 372 416 add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); 373 417 374 418 /** 375 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. 419 * Show a home link for the wp_nav_menu() fallback, wp_page_menu(). 420 * 421 * @since Twenty Eleven 1.0 422 * 423 * @param array $args The page menu arguments. @see wp_page_menu() 424 * @return array The filtered page menu arguments. 376 425 */ 377 426 function twentyeleven_page_menu_args( $args ) { 378 427 if ( ! isset( $args['show_home'] ) ) … … 382 431 add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); 383 432 384 433 /** 385 * Register our sidebars and widgetized areas. Also register the default Epherma widget.434 * Register sidebars and widgetized areas. 386 435 * 436 * Also register the default Epherma widget. 437 * 387 438 * @since Twenty Eleven 1.0 388 439 */ 389 440 function twentyeleven_widgets_init() { … … 443 494 444 495 if ( ! function_exists( 'twentyeleven_content_nav' ) ) : 445 496 /** 446 * Display navigation to next/previous pages when applicable 497 * Display navigation to next/previous pages when applicable. 498 * 499 * @since Twenty Eleven 1.0 500 * 501 * @param string $html_id The HTML id attribute. 447 502 */ 448 503 function twentyeleven_content_nav( $html_id ) { 449 504 global $wp_query; … … 462 517 * Return the first link from the post content. If none found, the 463 518 * post permalink is used as a fallback. 464 519 * 520 * @since Twenty Eleven 1.0 521 * 465 522 * @uses get_url_in_content() to get the first URL from the post content. 466 523 * 467 * @return string 524 * @return string The first link. 468 525 */ 469 526 function twentyeleven_get_first_url() { 470 527 $content = get_the_content(); … … 473 530 if ( ! $has_url ) 474 531 $has_url = twentyeleven_url_grabber(); 475 532 533 //duplicate_hook 476 534 return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); 477 535 } 478 536 … … 480 538 * Return the URL for the first link found in the post content. 481 539 * 482 540 * @since Twenty Eleven 1.0 541 * 483 542 * @return string|bool URL or false when no link is present. 484 543 */ 485 544 function twentyeleven_url_grabber() { … … 490 549 } 491 550 492 551 /** 493 * Count the number of footer sidebars to enable dynamic classes for the footer 552 * Count the number of footer sidebars to enable dynamic classes for the footer. 553 * 554 * @since Twenty Eleven 1.0 494 555 */ 495 556 function twentyeleven_footer_sidebar_class() { 496 557 $count = 0; … … 532 593 * Used as a callback by wp_list_comments() for displaying the comments. 533 594 * 534 595 * @since Twenty Eleven 1.0 596 * 597 * @param object $comment The comment object. 598 * @param array $args An array of comment arguments. @see get_comment_reply_link() 599 * @param int $depth The depth of the comment. 535 600 */ 536 601 function twentyeleven_comment( $comment, $args, $depth ) { 537 602 $GLOBALS['comment'] = $comment; … … 593 658 594 659 if ( ! function_exists( 'twentyeleven_posted_on' ) ) : 595 660 /** 596 * Prints HTML with meta information for the current post-date/time and author. 661 * Print HTML with meta information for the current post-date/time and author. 662 * 597 663 * Create your own twentyeleven_posted_on to override in a child theme 598 664 * 599 665 * @since Twenty Eleven 1.0 … … 612 678 endif; 613 679 614 680 /** 615 * Adds two classes to the array of body classes. 681 * Add two classes to the array of body classes. 682 * 616 683 * The first is if the site has only had one author with published posts. 617 684 * The second is if a singular post being displayed 618 685 * 619 686 * @since Twenty Eleven 1.0 687 * 688 * @param array $classes Existing body classes. 689 * @return array The filtered array of body classes. 620 690 */ 621 691 function twentyeleven_body_classes( $classes ) { 622 692 … … 631 701 add_filter( 'body_class', 'twentyeleven_body_classes' ); 632 702 633 703 /** 634 * Retrieve sthe IDs for images in a gallery.704 * Retrieve the IDs for images in a gallery. 635 705 * 636 * @uses get_post_galleries() first, if available. Falls back to shortcode parsing,637 * then as last option uses a get_posts() call.706 * @uses get_post_galleries() First, if available. Falls back to shortcode parsing, 707 * then as last option uses a get_posts() call. 638 708 * 639 709 * @since Twenty Eleven 1.6. 640 710 * -
src/wp-content/themes/twentyeleven/header.php
1 1 <?php 2 2 /** 3 * The Header for our theme.3 * Header template for the theme 4 4 * 5 * Displays all of the <head> section and everything up till <div id="main"> 5 * Displays all of the <head> section and everything up till <div id="main">. 6 6 * 7 7 * @package WordPress 8 8 * @subpackage Twenty_Eleven … … 25 25 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 26 26 <meta name="viewport" content="width=device-width" /> 27 27 <title><?php 28 /* 28 /** 29 29 * Print the <title> tag based on what is being viewed. 30 30 */ 31 31 global $page, $paged; … … 52 52 <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script> 53 53 <![endif]--> 54 54 <?php 55 /* We add some JavaScript to pages with the comment form 55 /** 56 * We add some JavaScript to pages with the comment form 56 57 * to support sites with threaded comments (when in use). 57 58 */ 58 59 if ( is_singular() && get_option( 'thread_comments' ) ) 59 60 wp_enqueue_script( 'comment-reply' ); 60 61 61 /* Always have wp_head() just before the closing </head> 62 /** 63 * Always have wp_head() just before the closing </head> 62 64 * tag of your theme, or you will break many plugins, which 63 65 * generally use this hook to add elements to <head> such 64 66 * as styles, scripts, and meta tags. … … 81 83 if ( $header_image ) : 82 84 // Compatibility with versions of WordPress prior to 3.4. 83 85 if ( function_exists( 'get_custom_header' ) ) { 84 // We need to figure out what the minimum width should be for our featured image. 85 // This result would be the suggested width if the theme were to implement flexible widths. 86 /** 87 * We need to figure out what the minimum width should be for our featured image. 88 * This result would be the suggested width if the theme were to implement flexible widths. 89 */ 86 90 $header_image_width = get_theme_support( 'custom-header', 'width' ); 87 91 } else { 88 92 $header_image_width = HEADER_IMAGE_WIDTH; … … 90 94 ?> 91 95 <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> 92 96 <?php 93 // The header image 94 // Check if this is a post or page, if it has a thumbnail, and if it's a big one 97 /** 98 * The header image. 99 * Check if this is a post or page, if it has a thumbnail, and if it's a big one 100 */ 95 101 if ( is_singular() && has_post_thumbnail( $post->ID ) && 96 102 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && 97 103 $image[1] >= $header_image_width ) : -
src/wp-content/themes/twentyeleven/image.php
1 1 <?php 2 2 /** 3 * T he template for displaying image attachments.3 * Template for displaying image attachments 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 72 72 } 73 73 ?> 74 74 <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php 75 /** 76 * Filter the Twenty Eleven default attachment size. 77 * 78 * @since Twenty Eleven 1.0 79 * 80 * @param int The height and width attachment size dimensions in pixels. Default 848. 81 */ 75 82 $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 ); 76 83 echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height. 77 84 ?></a> -
src/wp-content/themes/twentyeleven/inc/theme-options.php
14 14 * 15 15 * @since Twenty Eleven 1.0 16 16 * 17 * @param string $hook_suffix An admin page's hook suffix. 17 18 */ 18 19 function twentyeleven_admin_enqueue_scripts( $hook_suffix ) { 19 20 wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' ); … … 51 52 52 53 // Register our individual settings fields 53 54 add_settings_field( 54 'color_scheme', // Unique identifier for the field for this section55 __( 'Color Scheme', 'twentyeleven' ), // Setting field label55 'color_scheme', // Unique identifier for the field for this section 56 __( 'Color Scheme', 'twentyeleven' ), // Setting field label 56 57 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field 57 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()58 'general' // Settings section. Same as the first argument in the add_settings_section() above58 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() 59 'general' // Settings section. Same as the first argument in the add_settings_section() above 59 60 ); 60 61 61 62 add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' ); … … 66 67 /** 67 68 * Change the capability required to save the 'twentyeleven_options' options group. 68 69 * 69 * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.70 * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group. 70 71 * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page. 71 72 * 72 73 * By default, the options groups for all registered settings require the manage_options capability. … … 83 84 add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' ); 84 85 85 86 /** 86 * Add ourtheme options page to the admin menu, including some help documentation.87 * Add a theme options page to the admin menu, including some help documentation. 87 88 * 88 89 * This function is attached to the admin_menu action hook. 89 90 * … … 122 123 $screen = get_current_screen(); 123 124 124 125 if ( method_exists( $screen, 'add_help_tab' ) ) { 125 // WordPress 3.3 126 // WordPress 3.3.0 126 127 $screen->add_help_tab( array( 127 128 'title' => __( 'Overview', 'twentyeleven' ), 128 129 'id' => 'theme-options-help', … … 132 133 133 134 $screen->set_help_sidebar( $sidebar ); 134 135 } else { 135 // WordPress 3.2 136 // WordPress 3.2.0 136 137 add_contextual_help( $screen, $help . $sidebar ); 137 138 } 138 139 } 139 140 140 141 /** 141 * Return san array of color schemes registered for Twenty Eleven.142 * Return an array of color schemes registered for Twenty Eleven. 142 143 * 143 144 * @since Twenty Eleven 1.0 144 145 */ … … 158 159 ), 159 160 ); 160 161 162 /** 163 * Filter the Twenty Eleven color scheme options. 164 * 165 * @since Twenty Eleven 1.0 166 * 167 * @param array $color_scheme_options An associative array of color scheme options. 168 */ 161 169 return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options ); 162 170 } 163 171 164 172 /** 165 * Return san array of layout options registered for Twenty Eleven.173 * Return an array of layout options registered for Twenty Eleven. 166 174 * 167 175 * @since Twenty Eleven 1.0 168 176 */ … … 185 193 ), 186 194 ); 187 195 196 /** 197 * Filter the Twenty Eleven layout options. 198 * 199 * @since Twenty Eleven 1.0 200 * 201 * @param array $layout_options An associative array of layout options. 202 */ 188 203 return apply_filters( 'twentyeleven_layouts', $layout_options ); 189 204 } 190 205 191 206 /** 192 * Return sthe default options for Twenty Eleven.207 * Return the default options for Twenty Eleven. 193 208 * 194 209 * @since Twenty Eleven 1.0 210 * 211 * @return array An array of default theme options. 195 212 */ 196 213 function twentyeleven_get_default_theme_options() { 197 214 $default_theme_options = array( … … 203 220 if ( is_rtl() ) 204 221 $default_theme_options['theme_layout'] = 'sidebar-content'; 205 222 223 /** 224 * Filter the Twenty Eleven default options. 225 * 226 * @since Twenty Eleven 1.0 227 * 228 * @param array $default_theme_options An array of default theme options. 229 */ 206 230 return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options ); 207 231 } 208 232 209 233 /** 210 * Return sthe default link color for Twenty Eleven, based on color scheme.234 * Return the default link color for Twenty Eleven, based on color scheme. 211 235 * 212 236 * @since Twenty Eleven 1.0 213 237 * 214 * @param $string $color_scheme Color scheme. Defaults to the active color scheme. 215 * @return $string Color. 238 * @param string $color_scheme Optional. Color scheme. 239 * Default null (or the active color scheme). 240 * @return string The default link color. 216 241 */ 217 242 function twentyeleven_get_default_link_color( $color_scheme = null ) { 218 243 if ( null === $color_scheme ) { … … 228 253 } 229 254 230 255 /** 231 * Return sthe options array for Twenty Eleven.256 * Return the options array for Twenty Eleven. 232 257 * 233 258 * @since Twenty Eleven 1.0 234 259 */ … … 237 262 } 238 263 239 264 /** 240 * Render sthe Color Scheme setting field.265 * Render the Color Scheme setting field. 241 266 * 242 267 * @since Twenty Eleven 1.3 243 268 */ … … 261 286 } 262 287 263 288 /** 264 * Render sthe Link Color setting field.289 * Render the Link Color setting field. 265 290 * 266 291 * @since Twenty Eleven 1.3 267 292 */ … … 278 303 } 279 304 280 305 /** 281 * Render sthe Layout setting field.306 * Render the Layout setting field. 282 307 * 283 308 * @since Twenty Eleven 1.3 284 309 */ … … 300 325 } 301 326 302 327 /** 303 * Return sthe options array for Twenty Eleven.328 * Return the options array for Twenty Eleven. 304 329 * 305 330 * @since Twenty Eleven 1.2 306 331 */ … … 324 349 } 325 350 326 351 /** 327 * Sanitize and validate form input. Accepts an array, return a sanitized array.352 * Sanitize and validate form input. 328 353 * 354 * Accepts an array, return a sanitized array. 355 * 329 356 * @see twentyeleven_theme_options_init() 330 357 * @todo set up Reset Options action 331 358 * 332 359 * @since Twenty Eleven 1.0 360 * 361 * @param array $input An array of form input. 333 362 */ 334 363 function twentyeleven_theme_options_validate( $input ) { 335 364 $output = $defaults = twentyeleven_get_default_theme_options(); … … 349 378 if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) ) 350 379 $output['theme_layout'] = $input['theme_layout']; 351 380 381 /** 382 * Filter the Twenty Eleven sanitized form input array. 383 * 384 * @since Twenty Eleven 1.0 385 * 386 * @param array $output An array of sanitized form output. 387 * @param array $input An array of un-sanitized form input. 388 * @param array $defaults An array of default theme options. 389 */ 352 390 return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults ); 353 391 } 354 392 … … 364 402 if ( 'dark' == $color_scheme ) 365 403 wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null ); 366 404 405 /** 406 * Fires after the styles for the Twenty Eleven color scheme are enqueued. 407 * 408 * @since Twenty Eleven 1.0 409 * 410 * @param string $color_scheme The color scheme. 411 */ 367 412 do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme ); 368 413 } 369 414 add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' ); … … 417 462 add_action( 'wp_head', 'twentyeleven_print_link_color_style' ); 418 463 419 464 /** 420 * Add sTwenty Eleven layout classes to the array of body classes.465 * Add Twenty Eleven layout classes to the array of body classes. 421 466 * 422 467 * @since Twenty Eleven 1.0 468 * 469 * @param array $existing_classes An array of existing body classes. 423 470 */ 424 471 function twentyeleven_layout_classes( $existing_classes ) { 425 472 $options = twentyeleven_get_theme_options(); … … 437 484 else 438 485 $classes[] = $current_layout; 439 486 487 /** 488 * Filter the Twenty Eleven layout body classes. 489 * 490 * @since Twenty Eleven 1.0 491 * 492 * @param array $classes An array of body classes. 493 * @param string $current_layout The current theme layout. 494 */ 440 495 $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout ); 441 496 442 497 return array_merge( $existing_classes, $classes ); … … 446 501 /** 447 502 * Implements Twenty Eleven theme options into Theme Customizer 448 503 * 449 * @param $wp_customize Theme Customizer object 504 * @since Twenty Eleven 1.3 505 * 506 * @param object $wp_customize Theme Customizer object. 450 507 * @return void 451 508 * 452 * @since Twenty Eleven 1.3453 509 */ 454 510 function twentyeleven_customize_register( $wp_customize ) { 455 511 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; … … 521 577 522 578 /** 523 579 * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. 580 * 524 581 * Used with blogname and blogdescription. 525 582 * 526 583 * @since Twenty Eleven 1.3 -
src/wp-content/themes/twentyeleven/inc/widgets.php
1 1 <?php 2 2 /** 3 * Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven3 * Widget For displaying post format posts 4 4 * 5 * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets5 * Handles displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven. 6 6 * 7 * @link http://codex.wordpress.org/Widgets_API#Developing_Widgets 8 * 7 9 * @package WordPress 8 10 * @subpackage Twenty_Eleven 9 11 * @since Twenty Eleven 1.0 … … 13 15 /** 14 16 * Constructor 15 17 * 18 * @since Twenty Eleven 1.0 19 * 16 20 * @return void 17 21 **/ 18 22 function Twenty_Eleven_Ephemera_Widget() { … … 28 32 /** 29 33 * Outputs the HTML for this widget. 30 34 * 31 * @param array An array of standard parameters for widgets in this theme 32 * @param array An array of settings for this widget instance 33 * @return void Echoes its output 35 * @since Twenty Eleven 1.0 36 * 37 * @param array $args An array of standard parameters for widgets in this theme. 38 * @param array $instance An array of settings for this widget instance. 39 * @return void 34 40 **/ 35 41 function widget( $args, $instance ) { 36 42 $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); … … 49 55 ob_start(); 50 56 extract( $args, EXTR_SKIP ); 51 57 58 //duplicate_hook 52 59 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base); 53 60 54 61 if ( ! isset( $instance['number'] ) ) … … 120 127 } 121 128 122 129 /** 130 * Update widget settings. 131 * 123 132 * Deals with the settings when they are saved by the admin. Here is 124 133 * where any validation should be dealt with. 134 * 135 * @since Twenty Eleven 1.0 125 136 **/ 126 137 function update( $new_instance, $old_instance ) { 127 138 $instance = $old_instance; … … 136 147 return $instance; 137 148 } 138 149 150 /** 151 * Flush widget cache. 152 * 153 * @since Twenty Eleven 1.0 154 */ 139 155 function flush_widget_cache() { 140 156 wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' ); 141 157 } 142 158 143 159 /** 160 * Set up the widget form. 161 * 144 162 * Displays the form for this widget on the Widgets page of the WP Admin area. 163 * 164 * @since Twenty Eleven 1.0 145 165 **/ 146 166 function form( $instance ) { 147 167 $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : ''; -
src/wp-content/themes/twentyeleven/index.php
1 1 <?php 2 2 /** 3 * The main template file.3 * Main template file 4 4 * 5 5 * This is the most generic template file in a WordPress theme 6 6 * and one of the two required files for a theme (the other being style.css). -
src/wp-content/themes/twentyeleven/page.php
1 1 <?php 2 2 /** 3 * T he template for displaying all pages.3 * Template for displaying all pages 4 4 * 5 5 * This is the template that displays all pages by default. 6 6 * Please note that this is the WordPress construct of pages -
src/wp-content/themes/twentyeleven/search.php
1 1 <?php 2 2 /** 3 * T he template for displaying Search Results pages.3 * Template for displaying Search Results pages 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 24 24 <?php while ( have_posts() ) : the_post(); ?> 25 25 26 26 <?php 27 /* Include the Post-Format-specific template for the content. 27 /** 28 * Include the Post-Format-specific template for the content. 28 29 * If you want to overload this in a child theme then include a file 29 * called content-___.php (where ___ is the Post Format name) and that will be used instead. 30 * called content-___.php (where ___ is the Post Format name) and that 31 * will be used instead. 30 32 */ 31 33 get_template_part( 'content', get_post_format() ); 32 34 ?> -
src/wp-content/themes/twentyeleven/searchform.php
1 1 <?php 2 2 /** 3 * T he template for displaying search forms in Twenty Eleven3 * Template for displaying search forms in Twenty Eleven 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/showcase.php
1 1 <?php 2 2 /** 3 3 * Template Name: Showcase Template 4 * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts5 4 * 5 * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts. 6 * 6 7 * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts, 7 8 * another recent posts area (with the latest post shown in full and the rest as a list) 8 9 * and a left sidebar holding aside posts. -
src/wp-content/themes/twentyeleven/sidebar-footer.php
1 1 <?php 2 2 /** 3 * The Footer widget areas.3 * Footer widget areas 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 9 9 ?> 10 10 11 11 <?php 12 /* The footer widget area is triggered if any of the areas 12 /** 13 * The footer widget area is triggered if any of the areas 13 14 * have widgets. So let's check that first. 14 15 * 15 16 * If none of the sidebars have widgets, then let's bail early. -
src/wp-content/themes/twentyeleven/sidebar-page.php
1 1 <?php 2 2 /** 3 3 * Template Name: Sidebar Template 4 * Description: A Page Template that adds a sidebar to pages5 4 * 5 * Description: A Page Template that adds a sidebar to pages. 6 * 6 7 * @package WordPress 7 8 * @subpackage Twenty_Eleven 8 9 * @since Twenty Eleven 1.0 -
src/wp-content/themes/twentyeleven/sidebar.php
1 1 <?php 2 2 /** 3 * The Sidebar containing the main widget area.3 * Sidebar containing the main widget area 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/single.php
1 1 <?php 2 2 /** 3 * T he Template for displaying all single posts.3 * Template for displaying all single posts 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven -
src/wp-content/themes/twentyeleven/tag.php
1 1 <?php 2 2 /** 3 * T he template used to display Tag Archive pages3 * Template used to display Tag Archive pages 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Eleven … … 21 21 22 22 <?php 23 23 $tag_description = tag_description(); 24 if ( ! empty( $tag_description ) ) 24 if ( ! empty( $tag_description ) ) { 25 /** 26 * Filter the default Twenty Eleven tag description. 27 * 28 * @since Twenty Eleven 1.0 29 * 30 * @param string The default tag description. 31 */ 25 32 echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' ); 33 } 26 34 ?> 27 35 </header> 28 36 … … 32 40 <?php while ( have_posts() ) : the_post(); ?> 33 41 34 42 <?php 35 /* Include the Post-Format-specific template for the content. 43 /** 44 * Include the Post-Format-specific template for the content. 36 45 * If you want to overload this in a child theme then include a file 37 * called content-___.php (where ___ is the Post Format name) and that will be used instead. 46 * called content-___.php (where ___ is the Post Format name) and that 47 * will be used instead. 38 48 */ 39 49 get_template_part( 'content', get_post_format() ); 40 50 ?>