Make WordPress Core

Ticket #41057: 41057-src-wp-content.diff

File 41057-src-wp-content.diff, 325.2 KB (added by netweb, 8 years ago)
  • src/wp-content/plugins/hello.php

     
    7979
    8080add_action( 'admin_head', 'dolly_css' );
    8181
    82 ?>
     82
  • src/wp-content/themes/twentyeleven/404.php

     
    2222
    2323                                        <?php get_search_form(); ?>
    2424
    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                                        ) ); ?>
    2630
    2731                                        <div class="widget">
    2832                                                <h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2>
    2933                                                <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                                                ) ); ?>
    3141                                                </ul>
    3242                                        </div>
    3343
    3444                                        <?php
    3545                                        /* translators: %1$s: smilie */
    3646                                        $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                                        ) );
    3853                                        ?>
    3954
    4055                                        <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
     
    4560                </div><!-- #content -->
    4661        </div><!-- #primary -->
    4762
    48 <?php get_footer(); ?>
    49  No newline at end of file
     63<?php get_footer(); ?>
  • src/wp-content/themes/twentyeleven/author.php

     
    9898                </section><!-- #primary -->
    9999
    100100<?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

     
    2121
    2222                                        <?php
    2323                                                $category_description = category_description();
    24                                                 if ( ! empty( $category_description ) ) {
    25                                                         /**
     24                                        if ( ! empty( $category_description ) ) {
     25                                                /**
    2626                                                         * Filter the default Twenty Eleven category description.
    2727                                                         *
    2828                                                         * @since Twenty Eleven 1.0
    2929                                                         *
    3030                                                         * @param string The default category description HTML.
    3131                                                         */
    32                                                         echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
    33                                                 }
     32                                                echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
     33                                        }
    3434                                        ?>
    3535                                </header>
    3636
  • src/wp-content/themes/twentyeleven/comments.php

     
    3232                <h2 id="comments-title">
    3333                        <?php
    3434                                printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyeleven' ),
    35                                         number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
     35                                number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
    3636                        ?>
    3737                </h2>
    3838
     
    5353                                 * define twentyeleven_comment() and that will be used instead.
    5454                                 * See twentyeleven_comment() in twentyeleven/functions.php for more.
    5555                                 */
    56                                 wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
     56                                wp_list_comments( array(
     57                                        'callback' => 'twentyeleven_comment',
     58                                ) );
    5759                        ?>
    5860                </ol>
    5961
  • src/wp-content/themes/twentyeleven/content-featured.php

     
    2020
    2121        <div class="entry-summary">
    2222                <?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                ) ); ?>
    2427        </div><!-- .entry-content -->
    2528
    2629        <footer class="entry-meta">
    2730                <?php
    2831                        /* translators: used between list items, there is a space after the comma */
    2932                        $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    30                         if ( '' != $tag_list ) {
    31                                 $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' );
    32                         } else {
    33                                 $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' );
    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                }
    3538                        printf(
    3639                                $utility_text,
    3740                                /* translators: used between list items, there is a space after the comma */
  • src/wp-content/themes/twentyeleven/content-image.php

     
    2727
    2828                <div class="entry-content">
    2929                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</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                        ) ); ?>
    3134                </div><!-- .entry-content -->
    3235
    3336                <footer class="entry-meta">
     
    4750                                <?php
    4851                                        /* translators: used between list items, there is a space after the comma */
    4952                                        $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    50                                         if ( $categories_list ):
     53                                if ( $categories_list ) :
    5154                                ?>
    5255                                <span class="cat-links">
    53                                         <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
     56                                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
    5457                                </span>
    5558                                <?php endif; // End if categories ?>
    5659                                <?php
    5760                                        /* translators: used between list items, there is a space after the comma */
    5861                                        $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    59                                         if ( $tags_list ): ?>
     62                                if ( $tags_list ) : ?>
    6063                                <span class="tag-links">
    6164                                        <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    6265                                </span>
  • src/wp-content/themes/twentyeleven/content-intro.php

     
    1515
    1616        <div class="entry-content">
    1717                <?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                ) ); ?>
    1922                <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    2023        </div><!-- .entry-content -->
    2124</article><!-- #post-<?php the_ID(); ?> -->
  • src/wp-content/themes/twentyeleven/content-page.php

     
    1515
    1616        <div class="entry-content">
    1717                <?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                ) ); ?>
    1922        </div><!-- .entry-content -->
    2023        <footer class="entry-meta">
    2124                <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
  • src/wp-content/themes/twentyeleven/content-quote.php

     
    3333                <?php else : ?>
    3434                <div class="entry-content">
    3535                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</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                        ) ); ?>
    3740                </div><!-- .entry-content -->
    3841                <?php endif; ?>
    3942
     
    4245                        <?php
    4346                                /* translators: used between list items, there is a space after the comma */
    4447                                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    45                                 if ( $categories_list ):
     48                        if ( $categories_list ) :
    4649                        ?>
    4750                        <span class="cat-links">
    48                                 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    49                                 $show_sep = true; ?>
     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; ?>
    5053                        </span>
    5154                        <?php endif; // End if categories ?>
    5255                        <?php
    5356                                /* translators: used between list items, there is a space after the comma */
    5457                                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    55                                 if ( $tags_list ):
     58                        if ( $tags_list ) :
    5659                                if ( $show_sep ) : ?>
    5760                        <span class="sep"> | </span>
    5861                                <?php endif; // End if $show_sep ?>
  • src/wp-content/themes/twentyeleven/content-single.php

     
    3131
    3232                        /* translators: used between list items, there is a space after the comma */
    3333                        $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    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                         }
     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                }
    4141
    4242                        printf(
    4343                                $utility_text,
  • src/wp-content/themes/twentyeleven/content.php

     
    3939                <?php else : ?>
    4040                <div class="entry-content">
    4141                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</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                        ) ); ?>
    4346                </div><!-- .entry-content -->
    4447                <?php endif; ?>
    4548
     
    4952                        <?php
    5053                                /* translators: used between list items, there is a space after the comma */
    5154                                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    52                                 if ( $categories_list ):
     55                        if ( $categories_list ) :
    5356                        ?>
    5457                        <span class="cat-links">
    55                                 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    56                                 $show_sep = true; ?>
     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; ?>
    5760                        </span>
    5861                        <?php endif; // End if categories ?>
    5962                        <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>
     
    6164                        <?php
    6265                                /* translators: used between list items, there is a space after the comma */
    6366                                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    64                                 if ( $tags_list ):
     67                        if ( $tags_list ) :
    6568                                if ( $show_sep ) : ?>
    6669                        <span class="sep"> | </span>
    6770                                <?php endif; // End if $show_sep ?>
  • src/wp-content/themes/twentyeleven/footer.php

     
    1919                                 * A sidebar in the footer? Yep. You can customize
    2020                                 * your footer with three columns of widgets.
    2121                                 */
    22                                 if ( ! is_404() )
    23                                         get_sidebar( 'footer' );
     22                        if ( ! is_404() ) {
     23                                get_sidebar( 'footer' );
     24                        }
    2425                        ?>
    2526
    2627                        <div id="site-generator">
     
    3334<?php wp_footer(); ?>
    3435
    3536</body>
    36 </html>
    37  No newline at end of file
     37</html>
  • src/wp-content/themes/twentyeleven/functions.php

     
    3939 */
    4040
    4141// Set the content width based on the theme's design and stylesheet.
    42 if ( ! isset( $content_width ) )
     42if ( ! isset( $content_width ) ) {
    4343        $content_width = 584;
     44}
    4445
    4546/*
    4647 * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run.
    4748 */
    4849add_action( 'after_setup_theme', 'twentyeleven_setup' );
    4950
    50 if ( ! function_exists( 'twentyeleven_setup' ) ):
    51 /**
     51if ( ! function_exists( 'twentyeleven_setup' ) ) :
     52        /**
    5253 * Set up theme defaults and registers support for various WordPress features.
    5354 *
    5455 * Note that this function is hooked into the after_setup_theme hook, which runs
     
    6869 *
    6970 * @since Twenty Eleven 1.0
    7071 */
    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() {
    10573
    106         // Add support for custom backgrounds.
    107         add_theme_support( 'custom-background', array(
    10874                /*
    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.
    11180                 */
    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' );
    11488
    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                }
    117106
    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                        /**
    124125                 * Filter the Twenty Eleven default header image width.
    125126                 *
    126127                 * @since Twenty Eleven 1.0
    127128                 *
    128129                 * @param int The default header image width in pixels. Default 1000.
    129130                 */
    130                 'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),
    131                 /**
     131                        'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),
     132                        /**
    132133                 * Filter the Twenty Eleven default header image height.
    133134                 *
    134135                 * @since Twenty Eleven 1.0
    135136                 *
    136137                 * @param int The default header image height in pixels. Default 288.
    137138                 */
    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                }
    229163
    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        }
    233234endif; // twentyeleven_setup
    234235
    235236if ( ! function_exists( 'twentyeleven_header_style' ) ) :
    236 /**
     237        /**
    237238 * Styles the header image and text displayed on the blog.
    238239 *
    239240 * @since Twenty Eleven 1.0
    240241 */
    241 function twentyeleven_header_style() {
    242         $text_color = get_header_textcolor();
     242        function twentyeleven_header_style() {
     243                $text_color = get_header_textcolor();
    243244
    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                }
    247249
    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         <?php
     250                // 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
    252254                // Has the text been hidden?
    253255                if ( 'blank' == $text_color ) :
    254256        ?>
     
    269271        <?php endif; ?>
    270272        </style>
    271273        <?php
    272 }
     274        }
    273275endif; // twentyeleven_header_style
    274276
    275277if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) :
    276 /**
     278        /**
    277279 * Styles the header image displayed on the Appearance > Header admin panel.
    278280 *
    279281 * Referenced via add_theme_support('custom-header') in twentyeleven_setup().
    280282 *
    281283 * @since Twenty Eleven 1.0
    282284 */
    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 {
    287289                border: none;
    288         }
    289         #headimg h1,
    290         #desc {
     290                }
     291                #headimg h1,
     292                #desc {
    291293                font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
    292         }
    293         #headimg h1 {
     294                }
     295                #headimg h1 {
    294296                margin: 0;
    295         }
    296         #headimg h1 a {
     297                }
     298                #headimg h1 a {
    297299                font-size: 32px;
    298300                line-height: 36px;
    299301                text-decoration: none;
    300         }
    301         #desc {
     302                }
     303                #desc {
    302304                font-size: 14px;
    303305                line-height: 23px;
    304306                padding: 0 0 3em;
    305         }
    306         <?php
     307                }
     308                <?php
    307309                // If the user has set a custom color for the text use that
    308310                if ( get_header_textcolor() != HEADER_TEXTCOLOR ) :
    309311        ?>
    310                 #site-title a,
    311                 #site-description {
    312                         color: #<?php echo get_header_textcolor(); ?>;
    313                 }
     312        #site-title a,
     313        #site-description {
     314                color: #<?php echo get_header_textcolor(); ?>;
     315        }
    314316        <?php endif; ?>
    315317        #headimg img {
    316318                max-width: 1000px;
     
    318320                width: 100%;
    319321        }
    320322        </style>
    321 <?php
    322 }
     323        <?php
     324        }
    323325endif; // twentyeleven_admin_header_style
    324326
    325327if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) :
    326 /**
     328        /**
    327329 * Custom header image markup displayed on the Appearance > Header admin panel.
    328330 *
    329331 * Referenced via add_theme_support('custom-header') in twentyeleven_setup().
    330332 *
    331333 * @since Twenty Eleven 1.0
    332334 */
    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 ) : ?>
    346349                        <img src="<?php echo esc_url( $image ); ?>" alt="" />
    347350                <?php endif; ?>
    348         </div>
    349 <?php }
     351                        </div>
     352                <?php }
    350353endif; // twentyeleven_admin_header_image
    351354
    352355/**
     
    367370add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
    368371
    369372if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) :
    370 /**
     373        /**
    371374 * Return a "Continue Reading" link for excerpts
    372375 *
    373376 * @since Twenty Eleven 1.0
    374377 *
    375378 * @return string The "Continue Reading" HTML link.
    376379 */
    377 function twentyeleven_continue_reading_link() {
    378         return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';
    379 }
     380        function twentyeleven_continue_reading_link() {
     381                return ' <a href="' . esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';
     382        }
    380383endif; // twentyeleven_continue_reading_link
    381384
    382385/**
     
    428431 * @return array The filtered page menu arguments.
    429432 */
    430433function twentyeleven_page_menu_args( $args ) {
    431         if ( ! isset( $args['show_home'] ) )
     434        if ( ! isset( $args['show_home'] ) ) {
    432435                $args['show_home'] = true;
     436        }
    433437        return $args;
    434438}
    435439add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
     
    497501add_action( 'widgets_init', 'twentyeleven_widgets_init' );
    498502
    499503if ( ! function_exists( 'twentyeleven_content_nav' ) ) :
    500 /**
     504        /**
    501505 * Display navigation to next/previous pages when applicable.
    502506 *
    503507 * @since Twenty Eleven 1.0
    504508 *
    505509 * @param string $html_id The HTML id attribute.
    506510 */
    507 function twentyeleven_content_nav( $html_id ) {
    508         global $wp_query;
     511        function twentyeleven_content_nav( $html_id ) {
     512                global $wp_query;
    509513
    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">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div>
    514                         <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</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">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div>
     518                                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></div>
     519                        </nav><!-- #nav-above -->
     520                <?php endif;
     521        }
    518522endif; // twentyeleven_content_nav
    519523
    520524/**
     
    531535        $content = get_the_content();
    532536        $has_url = function_exists( 'get_url_in_content' ) ? get_url_in_content( $content ) : false;
    533537
    534         if ( ! $has_url )
     538        if ( ! $has_url ) {
    535539                $has_url = twentyeleven_url_grabber();
     540        }
    536541
    537542        /** This filter is documented in wp-includes/link-template.php */
    538543        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     
    546551 * @return string|bool URL or false when no link is present.
    547552 */
    548553function 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 ) ) {
    550555                return false;
     556        }
    551557
    552558        return esc_url_raw( $matches[1] );
    553559}
     
    560566function twentyeleven_footer_sidebar_class() {
    561567        $count = 0;
    562568
    563         if ( is_active_sidebar( 'sidebar-3' ) )
     569        if ( is_active_sidebar( 'sidebar-3' ) ) {
    564570                $count++;
     571        }
    565572
    566         if ( is_active_sidebar( 'sidebar-4' ) )
     573        if ( is_active_sidebar( 'sidebar-4' ) ) {
    567574                $count++;
     575        }
    568576
    569         if ( is_active_sidebar( 'sidebar-5' ) )
     577        if ( is_active_sidebar( 'sidebar-5' ) ) {
    570578                $count++;
     579        }
    571580
    572581        $class = '';
    573582
     
    583592                        break;
    584593        }
    585594
    586         if ( $class )
     595        if ( $class ) {
    587596                echo 'class="' . esc_attr( $class ) . '"';
     597        }
    588598}
    589599
    590600if ( ! function_exists( 'twentyeleven_comment' ) ) :
    591 /**
     601        /**
    592602 * Template for comments and pingbacks.
    593603 *
    594604 * To override this walker in a child theme without modifying the comments template
     
    602612 * @param array  $args    An array of comment arguments. @see get_comment_reply_link()
    603613 * @param int    $depth   The depth of the comment.
    604614 */
    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">
    612622                <p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p>
    613623        <?php
    614624                        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(); ?>">
    618628                <article id="comment-<?php comment_ID(); ?>" class="comment">
    619629                        <footer class="comment-meta">
    620630                                <div class="comment-author vcard">
    621631                                        <?php
    622632                                                $avatar_size = 68;
    623                                                 if ( '0' != $comment->comment_parent )
    624                                                         $avatar_size = 39;
     633                                        if ( '0' != $comment->comment_parent ) {
     634                                                $avatar_size = 39;
     635                                        }
    625636
    626637                                                echo get_avatar( $comment, $avatar_size );
    627638
     
    635646                                                                sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
    636647                                                        )
    637648                                                );
    638                                         ?>
     649                                                ?>
    639650
    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 -->
    642653
    643                                 <?php if ( $comment->comment_approved == '0' ) : ?>
     654                                        <?php if ( $comment->comment_approved == '0' ) : ?>
    644655                                        <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em>
    645656                                        <br />
    646657                                <?php endif; ?>
    647658
    648                         </footer>
     659                                </footer>
    649660
    650                         <div class="comment-content"><?php comment_text(); ?></div>
     661                                <div class="comment-content"><?php comment_text(); ?></div>
    651662
    652                         <div class="reply">
    653                                 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</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>&darr;</span>', 'twentyeleven' ),
     666                                                'depth' => $depth,
     667                                                'max_depth' => $args['max_depth'],
     668                                        ) ) ); ?>
     669                                </div><!-- .reply -->
     670                        </article><!-- #comment-## -->
    656671
    657         <?php
     672                <?php
    658673                        break;
    659         endswitch;
    660 }
     674                        endswitch;
     675        }
    661676endif; // ends check for twentyeleven_comment()
    662677
    663678if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
    664 /**
     679        /**
    665680 * Print HTML with meta information for the current post-date/time and author.
    666681 *
    667682 * Create your own twentyeleven_posted_on to override in a child theme
    668683 *
    669684 * @since Twenty Eleven 1.0
    670685 */
    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        }
    682697endif;
    683698
    684699/**
     
    694709 */
    695710function twentyeleven_body_classes( $classes ) {
    696711
    697         if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
     712        if ( function_exists( 'is_multi_author' ) && ! is_multi_author() ) {
    698713                $classes[] = 'single-author';
     714        }
    699715
    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' ) ) {
    701717                $classes[] = 'singular';
     718        }
    702719
    703720        return $classes;
    704721}
     
    719736
    720737        if ( function_exists( 'get_post_galleries' ) ) {
    721738                $galleries = get_post_galleries( get_the_ID(), false );
    722                 if ( isset( $galleries[0]['ids'] ) )
     739                if ( isset( $galleries[0]['ids'] ) ) {
    723740                        $images = explode( ',', $galleries[0]['ids'] );
     741                }
    724742        } else {
    725743                $pattern = get_shortcode_regex();
    726744                preg_match( "/$pattern/s", get_the_content(), $match );
    727745                $atts = shortcode_parse_atts( $match[3] );
    728                 if ( isset( $atts['ids'] ) )
     746                if ( isset( $atts['ids'] ) ) {
    729747                        $images = explode( ',', $atts['ids'] );
     748                }
    730749        }
    731750
    732751        if ( ! $images ) {
  • src/wp-content/themes/twentyeleven/header.php

     
    3535
    3636        // Add the blog description for the home/front page.
    3737        $site_description = get_bloginfo( 'description', 'display' );
    38         if ( $site_description && ( is_home() || is_front_page() ) )
    39                 echo " | $site_description";
     38if ( $site_description && ( is_home() || is_front_page() ) ) {
     39        echo " | $site_description";
     40}
    4041
    4142        // 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 ) ) );
     43if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
     44        echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) );
     45}
    4446
    4547        ?></title>
    4648<link rel="profile" href="http://gmpg.org/xfn/11" />
     
    5456         * We add some JavaScript to pages with the comment form
    5557         * to support sites with threaded comments (when in use).
    5658         */
    57         if ( is_singular() && get_option( 'thread_comments' ) )
    58                 wp_enqueue_script( 'comment-reply' );
     59if ( is_singular() && get_option( 'thread_comments' ) ) {
     60        wp_enqueue_script( 'comment-reply' );
     61}
    5962
    6063        /*
    6164         * Always have wp_head() just before the closing </head>
     
    7881                        <?php
    7982                                // Check to see if the header image has been removed
    8083                                $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 :
    82108                                        // Compatibility with versions of WordPress prior to 3.4.
    83109                                        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;
    89112                                        } else {
    90                                                 $header_image_width = HEADER_IMAGE_WIDTH;
     113                                                $header_image_width  = HEADER_IMAGE_WIDTH;
     114                                                $header_image_height = HEADER_IMAGE_HEIGHT;
    91115                                        }
    92116                                        ?>
    93                         <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    94                                 <?php
    95                                         /*
    96                                          * The header image.
    97                                          * Check if this is a post or page, if it has a thumbnail, and if it's a big one
    98                                          */
    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                                                 ?>
    114117                                        <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' ) ); ?>" />
    115118                                <?php endif; // end check for featured image or standard header ?>
    116119                        </a>
     
    118121
    119122                        <?php
    120123                                // Has the text been hidden?
    121                                 if ( 'blank' == get_header_textcolor() ) :
     124                        if ( 'blank' == get_header_textcolor() ) :
    122125                        ?>
    123                                 <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
    124                                 <?php get_search_form(); ?>
    125                                 </div>
     126                        <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
     127                        <?php get_search_form(); ?>
     128                        </div>
    126129                        <?php
    127130                                else :
    128131                        ?>
  • src/wp-content/themes/twentyeleven/image.php

     
    5252         * 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,
    5353         * 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
    5454         */
    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        ) ) );
     63foreach ( $attachments as $k => $attachment ) {
     64        if ( $attachment->ID == $post->ID ) {
     65                break;
    5966        }
     67}
    6068
    6169        // 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();
     70if ( 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 );
    7377        }
     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}
    7482?>
    7583                                                                        <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
    7684                                                                        /**
     
    95103
    96104                                                        <div class="entry-description">
    97105                                                                <?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                                                                ) ); ?>
    99110                                                        </div><!-- .entry-description -->
    100111
    101112                                                </div><!-- .entry-content -->
     
    109120                        </div><!-- #content -->
    110121                </div><!-- #primary -->
    111122
    112 <?php get_footer(); ?>
    113  No newline at end of file
     123<?php get_footer(); ?>
  • src/wp-content/themes/twentyeleven/inc/theme-options.php

     
    9999                'twentyeleven_theme_options_render_page' // Function that renders the options page
    100100        );
    101101
    102         if ( ! $theme_page )
     102        if ( ! $theme_page ) {
    103103                return;
     104        }
    104105
    105106        add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
    106107}
     
    217218                'theme_layout' => 'content-sidebar',
    218219        );
    219220
    220         if ( is_rtl() )
     221        if ( is_rtl() ) {
    221222                $default_theme_options['theme_layout'] = 'sidebar-content';
     223        }
    222224
    223225        /**
    224226         * Filter the Twenty Eleven default options.
     
    246248        }
    247249
    248250        $color_schemes = twentyeleven_color_schemes();
    249         if ( ! isset( $color_schemes[ $color_scheme ] ) )
     251        if ( ! isset( $color_schemes[ $color_scheme ] ) ) {
    250252                return false;
     253        }
    251254
    252255        return $color_schemes[ $color_scheme ]['default_link_color'];
    253256}
     
    364367        $output = $defaults = twentyeleven_get_default_theme_options();
    365368
    366369        // 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() ) ) {
    368371                $output['color_scheme'] = $input['color_scheme'];
     372        }
    369373
    370374        // Our defaults for the link color may have changed, based on the color scheme.
    371375        $output['link_color'] = $defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] );
    372376
    373377        // 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'] ) ) {
    375379                $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
     380        }
    376381
    377382        // 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() ) ) {
    379384                $output['theme_layout'] = $input['theme_layout'];
     385        }
    380386
    381387        /**
    382388         * Filter the Twenty Eleven sanitized form input array.
     
    399405        $options = twentyeleven_get_theme_options();
    400406        $color_scheme = $options['color_scheme'];
    401407
    402         if ( 'dark' == $color_scheme )
     408        if ( 'dark' == $color_scheme ) {
    403409                wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
     410        }
    404411
    405412        /**
    406413         * Fires after the styles for the Twenty Eleven color scheme are enqueued.
     
    427434        $default_options = twentyeleven_get_default_theme_options();
    428435
    429436        // 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 ) {
    431438                return;
     439        }
    432440?>
    433441        <style>
    434442                /* Link color */
     
    472480        $options = twentyeleven_get_theme_options();
    473481        $current_layout = $options['theme_layout'];
    474482
    475         if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )
     483        if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) ) {
    476484                $classes = array( 'two-column' );
    477         else
    478                 $classes = array( 'one-column' );
     485        } else { $classes = array( 'one-column' );
     486        }
    479487
    480         if ( 'content-sidebar' == $current_layout )
     488        if ( 'content-sidebar' == $current_layout ) {
    481489                $classes[] = 'right-sidebar';
    482         elseif ( 'sidebar-content' == $current_layout )
     490        } elseif ( 'sidebar-content' == $current_layout ) {
    483491                $classes[] = 'left-sidebar';
    484         else
    485                 $classes[] = $current_layout;
     492        } else { $classes[] = $current_layout;
     493        }
    486494
    487495        /**
    488496         * Filter the Twenty Eleven layout body classes.
  • src/wp-content/themes/twentyeleven/inc/widgets.php

     
    5050        function widget( $args, $instance ) {
    5151                $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
    5252
    53                 if ( ! is_array( $cache ) )
     53                if ( ! is_array( $cache ) ) {
    5454                        $cache = array();
     55                }
    5556
    56                 if ( ! isset( $args['widget_id'] ) )
     57                if ( ! isset( $args['widget_id'] ) ) {
    5758                        $args['widget_id'] = null;
     59                }
    5860
    5961                if ( ! is_customize_preview() && isset( $cache[ $args['widget_id'] ] ) ) {
    6062                        echo $cache[ $args['widget_id'] ];
     
    6769                /** This filter is documented in wp-includes/default-widgets.php */
    6870                $args['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base );
    6971
    70                 if ( ! isset( $instance['number'] ) )
     72                if ( ! isset( $instance['number'] ) ) {
    7173                        $instance['number'] = '10';
     74                }
    7275
    73                 if ( ! $args['number'] = absint( $instance['number'] ) )
     76                if ( ! $args['number'] = absint( $instance['number'] ) ) {
    7477                        $args['number'] = 10;
     78                }
    7579
    7680                $ephemera_args = array(
    7781                        'order'          => 'DESC',
     
    128132                        // Reset the post globals as this query will have stomped on it
    129133                        wp_reset_postdata();
    130134
    131                 // end check for ephemeral posts
     135                        // end check for ephemeral posts
    132136                endif;
    133137
    134138                $cache[ $args['widget_id'] ] = ob_get_flush();
     
    153157                $this->flush_widget_cache();
    154158
    155159                $alloptions = wp_cache_get( 'alloptions', 'options' );
    156                 if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) )
     160                if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) ) {
    157161                        delete_option( 'widget_twentyeleven_ephemera' );
     162                }
    158163
    159164                return $instance;
    160165        }
     
    176181         * @since Twenty Eleven 1.0
    177182         **/
    178183        function form( $instance ) {
    179                 $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : '';
     184                $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
    180185                $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10;
    181186?>
    182187                        <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyeleven' ); ?></label>
  • src/wp-content/themes/twentyeleven/page.php

     
    2828                        </div><!-- #content -->
    2929                </div><!-- #primary -->
    3030
    31 <?php get_footer(); ?>
    32  No newline at end of file
     31<?php get_footer(); ?>
  • src/wp-content/themes/twentyeleven/search.php

     
    5656                </section><!-- #primary -->
    5757
    5858<?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

     
    3030                                         * We are using a heading by rendering the_content
    3131                                         * If we have content for this page, let's display it.
    3232                                         */
    33                                         if ( '' != get_the_content() )
    34                                                 get_template_part( 'content', 'intro' );
     33                                if ( '' != get_the_content() ) {
     34                                        get_template_part( 'content', 'intro' );
     35                                }
    3536                                ?>
    3637
    3738                                <?php endwhile; ?>
     
    4647                                        $sticky = get_option( 'sticky_posts' );
    4748
    4849                                        // Proceed only if sticky posts exist.
    49                                         if ( ! empty( $sticky ) ) :
     50                                if ( ! empty( $sticky ) ) :
    5051
    5152                                        $featured_args = array(
    52                                                 'post__in' => $sticky,
    53                                                 'post_status' => 'publish',
    54                                                 'posts_per_page' => 10,
    55                                                 'no_found_rows' => true,
     53                                        'post__in' => $sticky,
     54                                        'post_status' => 'publish',
     55                                        'posts_per_page' => 10,
     56                                        'no_found_rows' => true,
    5657                                        );
    5758
    5859                                        // The Featured Posts query.
     
    6162                                        // Proceed only if published posts exist
    6263                                        if ( $featured->have_posts() ) :
    6364
    64                                         /*
    65                                          * We will need to count featured posts starting from zero
    66                                          * to create the slider navigation.
    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;
    6970
    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                                         else
    74                                                 $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                                        ?>
    7677
    77                                 <div class="featured-posts">
     78                                        <div class="featured-posts">
    7879                                        <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1>
    7980
    8081                                <?php
    81                                         // Let's roll.
    82                                         while ( $featured->have_posts() ) : $featured->the_post();
     82                                // Let's roll.
     83                                while ( $featured->have_posts() ) : $featured->the_post();
    8384
    8485                                        // Increase the counter.
    8586                                        $counter_slider++;
    8687
    8788                                        /*
    88                                          * We're going to add a class to our featured post for featured images
    89                                          * by default it'll have the feature-text class.
    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                                        */
    9192                                        $feature_class = 'feature-text';
    9293
    9394                                        if ( has_post_thumbnail() ) {
     
    107108
    108109                                        <section class="featured-post <?php echo esc_attr( $feature_class ); ?>" id="featured-post-<?php echo esc_attr( $counter_slider ); ?>">
    109110
    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                                                }
    124121                                                ?>
    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' ); ?>
    126127                                        </section>
    127128                                <?php endwhile; ?>
    128129
    129                                 <?php
     130                                        <?php
    130131                                        // Show slider only if we have more than one featured post.
    131132                                        if ( $featured->post_count > 1 ) :
    132                                 ?>
    133                                 <nav class="feature-slider">
     133                                        ?>
     134                                        <nav class="feature-slider">
    134135                                        <ul>
    135136                                        <?php
    136137
    137                                                 // Reset the counter so that we end up with matching elements
    138                                                 $counter_slider = 0;
     138                                        // Reset the counter so that we end up with matching elements
     139                                        $counter_slider = 0;
    139140
    140                                                 // Begin from zero
    141                                                 rewind_posts();
     141                                        // Begin from zero
     142                                        rewind_posts();
    142143
    143                                                 // Let's roll again.
    144                                                 while ( $featured->have_posts() ) : $featured->the_post();
    145                                                         $counter_slider++;
    146                                                         if ( 1 == $counter_slider )
    147                                                                 $class = ' class="active"';
    148                                                         else
    149                                                                 $class = '';
    150                                                 ?>
    151                                                 <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>
    152                                         <?php endwhile; ?>
     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; ?>
    153154                                        </ul>
    154155                                </nav>
    155156                                <?php endif; // End check for more than one sticky post. ?>
     
    207208                                        endwhile;
    208209
    209210                                        // If we had some posts, close the <ol>
    210                                         if ( $recent->post_count > 0 )
     211                                        if ( $recent->post_count > 0 ) {
    211212                                                echo '</ol>';
     213                                        }
    212214                                        ?>
    213215                                </section><!-- .recent-posts -->
    214216
     
    216218                                        <?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
    217219
    218220                                                <?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                                                ) );
    220225                                                ?>
    221226
    222227                                        <?php endif; // end sidebar widget area ?>
     
    225230                        </div><!-- #content -->
    226231                </div><!-- #primary -->
    227232
    228 <?php get_footer(); ?>
    229  No newline at end of file
     233<?php get_footer(); ?>
  • src/wp-content/themes/twentyeleven/sidebar-footer.php

     
    1515         *
    1616         * If none of the sidebars have widgets, then let's bail early.
    1717         */
    18         if (   ! is_active_sidebar( 'sidebar-3' )
     18if ( ! is_active_sidebar( 'sidebar-3' )
    1919                && ! is_active_sidebar( 'sidebar-4' )
    20                 && ! is_active_sidebar( 'sidebar-5'  )
    21         )
    22                 return;
     20                && ! is_active_sidebar( 'sidebar-5' )
     21        ) {
     22        return;
     23}
    2324        // If we get this far, we have widgets. Let do this.
    2425?>
    2526<div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>>
     
    4041                <?php dynamic_sidebar( 'sidebar-5' ); ?>
    4142        </div><!-- #third .widget-area -->
    4243        <?php endif; ?>
    43 </div><!-- #supplementary -->
    44  No newline at end of file
     44</div><!-- #supplementary -->
  • src/wp-content/themes/twentyeleven/sidebar-page.php

     
    2626                </div><!-- #primary -->
    2727
    2828<?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

     
    3333
    3434                        <?php endif; // end sidebar widget area ?>
    3535                </div><!-- #secondary .widget-area -->
    36 <?php endif; ?>
    37  No newline at end of file
     36<?php endif; ?>
  • src/wp-content/themes/twentyeleven/single.php

     
    2929                        </div><!-- #content -->
    3030                </div><!-- #primary -->
    3131
    32 <?php get_footer(); ?>
    33  No newline at end of file
     32<?php get_footer(); ?>
  • src/wp-content/themes/twentyeleven/tag.php

     
    2121
    2222                                        <?php
    2323                                                $tag_description = tag_description();
    24                                                 if ( ! empty( $tag_description ) ) {
    25                                                         /**
     24                                        if ( ! empty( $tag_description ) ) {
     25                                                /**
    2626                                                         * Filter the default Twenty Eleven tag description.
    2727                                                         *
    2828                                                         * @since Twenty Eleven 1.0
    2929                                                         *
    3030                                                         * @param string The default tag description.
    3131                                                         */
    32                                                         echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
    33                                                 }
     32                                                echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
     33                                        }
    3434                                        ?>
    3535                                </header>
    3636
  • src/wp-content/themes/twentyfifteen/archive.php

     
    4141                                 */
    4242                                get_template_part( 'content', get_post_format() );
    4343
    44                         // End the loop.
     44                                // End the loop.
    4545                        endwhile;
    4646
    4747                        // Previous/next page navigation.
     
    5151                                'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
    5252                        ) );
    5353
    54                 // If no content, include the "No posts found" template.
     54                        // If no content, include the "No posts found" template.
    5555                else :
    5656                        get_template_part( 'content', 'none' );
    5757
  • src/wp-content/themes/twentyfifteen/comments.php

     
    2626                <h2 class="comments-title">
    2727                        <?php
    2828                                printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentyfifteen' ),
    29                                         number_format_i18n( get_comments_number() ), get_the_title() );
     29                                number_format_i18n( get_comments_number() ), get_the_title() );
    3030                        ?>
    3131                </h2>
    3232
     
    4848
    4949        <?php
    5050                // If comments are closed and there are comments, let's leave a little note, shall we?
    51                 if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
     51        if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    5252        ?>
    53                 <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
     53        <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
    5454        <?php endif; ?>
    5555
    5656        <?php comment_form(); ?>
  • src/wp-content/themes/twentyfifteen/content-link.php

     
    1515
    1616        <header class="entry-header">
    1717                <?php
    18                         if ( is_single() ) :
    19                                 the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' );
     18                if ( is_single() ) :
     19                        the_title( sprintf( '<h1 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h1>' );
    2020                        else :
    2121                                the_title( sprintf( '<h2 class="entry-title"><a href="%s">', esc_url( twentyfifteen_get_link_url() ) ), '</a></h2>' );
    2222                        endif;
     
    4646
    4747        <?php
    4848                // Author bio.
    49                 if ( is_single() && get_the_author_meta( 'description' ) ) :
    50                         get_template_part( 'author-bio' );
     49        if ( is_single() && get_the_author_meta( 'description' ) ) :
     50                get_template_part( 'author-bio' );
    5151                endif;
    5252        ?>
    5353
  • src/wp-content/themes/twentyfifteen/content.php

     
    1818
    1919        <header class="entry-header">
    2020                <?php
    21                         if ( is_single() ) :
    22                                 the_title( '<h1 class="entry-title">', '</h1>' );
     21                if ( is_single() ) :
     22                        the_title( '<h1 class="entry-title">', '</h1>' );
    2323                        else :
    2424                                the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    2525                        endif;
     
    4747
    4848        <?php
    4949                // Author bio.
    50                 if ( is_single() && get_the_author_meta( 'description' ) ) :
    51                         get_template_part( 'author-bio' );
     50        if ( is_single() && get_the_author_meta( 'description' ) ) :
     51                get_template_part( 'author-bio' );
    5252                endif;
    5353        ?>
    5454
  • src/wp-content/themes/twentyfifteen/functions.php

     
    4242}
    4343
    4444if ( ! function_exists( 'twentyfifteen_setup' ) ) :
    45 /**
     45        /**
    4646 * Sets up theme defaults and registers support for various WordPress features.
    4747 *
    4848 * Note that this function is hooked into the after_setup_theme hook, which
     
    5151 *
    5252 * @since Twenty Fifteen 1.0
    5353 */
    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() {
    9655
    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                        ) );
    116128
    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], '#' );
    119131
    120         // Setup the WordPress core custom background feature.
     132                        // Setup the WordPress core custom background feature.
    121133
    122         /**
     134                        /**
    123135         * Filter Twenty Fifteen custom-header support arguments.
    124136         *
    125137         * @since Twenty Fifteen 1.0
     
    131143         *     @type string $default-attachment     Default attachment of the header.
    132144         * }
    133145         */
    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() ) );
    144156
    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        }
    148160endif; // twentyfifteen_setup
    149161add_action( 'after_setup_theme', 'twentyfifteen_setup' );
    150162
     
    169181add_action( 'widgets_init', 'twentyfifteen_widgets_init' );
    170182
    171183if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) :
    172 /**
     184        /**
    173185 * Register Google fonts for Twenty Fifteen.
    174186 *
    175187 * @since Twenty Fifteen 1.0
    176188 *
    177189 * @return string Google fonts URL for the theme.
    178190 */
    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 supported
    186         * 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                }
    191203
    192         /*
    193         * Translators: If there are characters in your language that are not supported
    194         * 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                }
    199211
    200         /*
    201         * Translators: If there are characters in your language that are not supported
    202         * 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                }
    207219
    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                }
    213235
    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                }
    223242
    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;
    229244        }
    230 
    231         return $fonts_url;
    232 }
    233245endif;
    234246
    235247/**
  • src/wp-content/themes/twentyfifteen/header.php

     
    3131                                <?php
    3232                                        twentyfifteen_the_custom_logo();
    3333
    34                                         if ( is_front_page() && is_home() ) : ?>
     34                                if ( is_front_page() && is_home() ) : ?>
    3535                                                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    3636                                        <?php else : ?>
    3737                                                <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
    3838                                        <?php endif;
    3939
    4040                                        $description = get_bloginfo( 'description', 'display' );
    41                                         if ( $description || is_customize_preview() ) : ?>
     41if ( $description || is_customize_preview() ) : ?>
    4242                                                <p class="site-description"><?php echo $description; ?></p>
    4343                                        <?php endif;
    4444                                ?>
  • src/wp-content/themes/twentyfifteen/image.php

     
    1414
    1515                        <?php
    1616                                // Start the loop.
    17                                 while ( have_posts() ) : the_post();
     17                        while ( have_posts() ) : the_post();
    1818                        ?>
    1919
    20                                 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     20                        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2121
    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                                                                 /**
     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                                                /**
    3737                                                                 * Filter the default Twenty Fifteen image attachment size.
    3838                                                                 *
    3939                                                                 * @since Twenty Fifteen 1.0
    4040                                                                 *
    4141                                                                 * @param string $image_size Image size. Default 'large'.
    4242                                                                 */
    43                                                                 $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' );
     43                                                $image_size = apply_filters( 'twentyfifteen_attachment_size', 'large' );
    4444
    45                                                                 echo wp_get_attachment_image( get_the_ID(), $image_size );
    46                                                         ?>
     45                                                echo wp_get_attachment_image( get_the_ID(), $image_size );
     46                                        ?>
    4747
    48                                                         <?php if ( has_excerpt() ) : ?>
     48                                        <?php if ( has_excerpt() ) : ?>
    4949                                                                <div class="entry-caption">
    5050                                                                        <?php the_excerpt(); ?>
    5151                                                                </div><!-- .entry-caption -->
     
    5454                                                </div><!-- .entry-attachment -->
    5555
    5656                                                <?php
    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                                                 ?>
     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                                        ?>
    6767                                        </div><!-- .entry-content -->
    6868
    6969                                        <footer class="entry-footer">
    70                                                 <?php twentyfifteen_entry_meta(); ?>
    71                                                 <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
     70                                        <?php twentyfifteen_entry_meta(); ?>
     71                                        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    7272                                        </footer><!-- .entry-footer -->
    7373
    7474                                </article><!-- #post-## -->
    7575
    7676                                <?php
    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();
     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();
    8080                                        endif;
    8181
    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                                         ) );
     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                                ) );
    8686
    8787                                // End the loop.
    8888                                endwhile;
  • src/wp-content/themes/twentyfifteen/inc/custom-header.php

     
    5353        $color = trim( $color, '#' );
    5454
    5555        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 if ( strlen( $color ) == 6 ) {
     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 ) {
    6060                $r = hexdec( substr( $color, 0, 2 ) );
    6161                $g = hexdec( substr( $color, 2, 2 ) );
    6262                $b = hexdec( substr( $color, 4, 2 ) );
     
    6464                return array();
    6565        }
    6666
    67         return array( 'red' => $r, 'green' => $g, 'blue' => $b );
     67        return array(
     68                'red' => $r,
     69                'green' => $g,
     70                'blue' => $b,
     71        );
    6872}
    6973
    7074if ( ! function_exists( 'twentyfifteen_header_style' ) ) :
    71 /**
     75        /**
    7276 * Styles the header image and text displayed on the blog.
    7377 *
    7478 * @since Twenty Fifteen 1.0
    7579 *
    7680 * @see twentyfifteen_custom_header_setup()
    7781 */
    78 function twentyfifteen_header_style() {
    79         $header_image = get_header_image();
     82        function twentyfifteen_header_style() {
     83                $header_image = get_header_image();
    8084
    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                }
    8589
    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         <?php
     90                // 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
    9094                // Short header for when there is no Custom Header and Header Text is hidden.
    9195                if ( empty( $header_image ) && ! display_header_text() ) :
    9296        ?>
     
    182186        <?php endif; ?>
    183187        </style>
    184188        <?php
    185 }
     189        }
    186190endif; // twentyfifteen_header_style
    187191
    188192/**
  • src/wp-content/themes/twentyfifteen/inc/customizer.php

     
    216216}
    217217
    218218if ( ! function_exists( 'twentyfifteen_get_color_scheme' ) ) :
    219 /**
     219        /**
    220220 * Get the current Twenty Fifteen color scheme.
    221221 *
    222222 * @since Twenty Fifteen 1.0
    223223 *
    224224 * @return array An associative array of either the current or default color scheme hex values.
    225225 */
    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();
    229229
    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                }
    233233
    234         return $color_schemes['default']['colors'];
    235 }
     234                return $color_schemes['default']['colors'];
     235        }
    236236endif; // twentyfifteen_get_color_scheme
    237237
    238238if ( ! function_exists( 'twentyfifteen_get_color_scheme_choices' ) ) :
    239 /**
     239        /**
    240240 * Returns an array of color scheme choices registered for Twenty Fifteen.
    241241 *
    242242 * @since Twenty Fifteen 1.0
    243243 *
    244244 * @return array Array of color schemes.
    245245 */
    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();
    249249
    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                }
    253253
    254         return $color_scheme_control_options;
    255 }
     254                return $color_scheme_control_options;
     255        }
    256256endif; // twentyfifteen_get_color_scheme_choices
    257257
    258258if ( ! function_exists( 'twentyfifteen_sanitize_color_scheme' ) ) :
    259 /**
     259        /**
    260260 * Sanitization callback for color schemes.
    261261 *
    262262 * @since Twenty Fifteen 1.0
     
    264264 * @param string $value Color scheme name value.
    265265 * @return string Color scheme name.
    266266 */
    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();
    269269
    270         if ( ! array_key_exists( $value, $color_schemes ) ) {
    271                 $value = 'default';
    272         }
     270                if ( ! array_key_exists( $value, $color_schemes ) ) {
     271                        $value = 'default';
     272                }
    273273
    274         return $value;
    275 }
     274                return $value;
     275        }
    276276endif; // twentyfifteen_sanitize_color_scheme
    277277
    278278/**
  • src/wp-content/themes/twentyfifteen/inc/template-tags.php

     
    1010 */
    1111
    1212if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) :
    13 /**
     13        /**
    1414 * Display navigation to next/previous comments when applicable.
    1515 *
    1616 * @since Twenty Fifteen 1.0
    1717 */
    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">
    2323                <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
    2424                <div class="nav-links">
    2525                        <?php
    26                                 if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
    27                                         printf( '<div class="nav-previous">%s</div>', $prev_link );
     26                        if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
     27                                printf( '<div class="nav-previous">%s</div>', $prev_link );
    2828                                endif;
    2929
    30                                 if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
    31                                         printf( '<div class="nav-next">%s</div>', $next_link );
     30                        if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
     31                                printf( '<div class="nav-next">%s</div>', $next_link );
    3232                                endif;
    3333                        ?>
    34                 </div><!-- .nav-links -->
    35         </nav><!-- .comment-navigation -->
    36         <?php
    37         endif;
    38 }
     34                        </div><!-- .nav-links -->
     35                </nav><!-- .comment-navigation -->
     36                <?php
     37                endif;
     38        }
    3939endif;
    4040
    4141if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) :
    42 /**
     42        /**
    4343 * Prints HTML with meta information for the categories, tags.
    4444 *
    4545 * @since Twenty Fifteen 1.0
    4646 */
    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                }
    6351
    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                        );
    6659                }
    6760
    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>';
    7463
    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                        );
    8174
    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
    8879                        );
    8980                }
    9081
    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                        }
    97106                }
    98107
    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 &times; %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']
    104117                        );
    105118                }
    106         }
    107119
    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 &times; %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                }
    125126        }
    126 }
    127127endif;
    128128
    129129/**
     
    172172add_action( 'save_post',     'twentyfifteen_category_transient_flusher' );
    173173
    174174if ( ! function_exists( 'twentyfifteen_post_thumbnail' ) ) :
    175 /**
     175        /**
    176176 * Display an optional post thumbnail.
    177177 *
    178178 * Wraps the post thumbnail in an anchor element on index views, or a div
     
    180180 *
    181181 * @since Twenty Fifteen 1.0
    182182 */
    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                }
    187187
    188         if ( is_singular() ) :
    189         ?>
     188                if ( is_singular() ) :
     189                ?>
    190190
    191         <div class="post-thumbnail">
     191                <div class="post-thumbnail">
    192192                <?php the_post_thumbnail(); ?>
    193193        </div><!-- .post-thumbnail -->
    194194
     
    201201        </a>
    202202
    203203        <?php endif; // End is_singular()
    204 }
     204        }
    205205endif;
    206206
    207207if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) :
    208 /**
     208        /**
    209209 * Return the post URL.
    210210 *
    211211 * Falls back to the post permalink if no URL is found in the post.
     
    216216 *
    217217 * @return string The Link format URL.
    218218 */
    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() );
    221221
    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        }
    224224endif;
    225225
    226226if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
    227 /**
     227        /**
    228228 * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link.
    229229 *
    230230 * @since Twenty Fifteen 1.0
    231231 *
    232232 * @return string 'Continue reading' link prepended with an ellipsis.
    233233 */
    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>' )
    239239                );
    240         return ' &hellip; ' . $link;
    241 }
    242 add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
     240                        return ' &hellip; ' . $link;
     241        }
     242        add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
    243243endif;
    244244
    245245if ( ! function_exists( 'twentyfifteen_the_custom_logo' ) ) :
    246 /**
     246        /**
    247247 * Displays the optional custom logo.
    248248 *
    249249 * Does nothing if the custom logo is not available.
    250250 *
    251251 * @since Twenty Fifteen 1.5
    252252 */
    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                }
    256257        }
    257 }
    258258endif;
  • src/wp-content/themes/twentyfifteen/index.php

     
    3838                                 */
    3939                                get_template_part( 'content', get_post_format() );
    4040
    41                         // End the loop.
     41                                // End the loop.
    4242                        endwhile;
    4343
    4444                        // Previous/next page navigation.
     
    4848                                'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
    4949                        ) );
    5050
    51                 // If no content, include the "No posts found" template.
     51                        // If no content, include the "No posts found" template.
    5252                else :
    5353                        get_template_part( 'content', 'none' );
    5454
  • src/wp-content/themes/twentyfifteen/page.php

     
    2828                                comments_template();
    2929                        endif;
    3030
    31                 // End the loop.
     31                        // End the loop.
    3232                endwhile;
    3333                ?>
    3434
  • src/wp-content/themes/twentyfifteen/search.php

     
    3030                                 */
    3131                                get_template_part( 'content', 'search' );
    3232
    33                         // End the loop.
     33                                // End the loop.
    3434                        endwhile;
    3535
    3636                        // Previous/next page navigation.
     
    4040                                'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
    4141                        ) );
    4242
    43                 // If no content, include the "No posts found" template.
     43                        // If no content, include the "No posts found" template.
    4444                else :
    4545                        get_template_part( 'content', 'none' );
    4646
  • src/wp-content/themes/twentyfifteen/sidebar.php

     
    77 * @since Twenty Fifteen 1.0
    88 */
    99
    10 if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' )  ) : ?>
     10if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) || is_active_sidebar( 'sidebar-1' ) ) : ?>
    1111        <div id="secondary" class="secondary">
    1212
    1313                <?php if ( has_nav_menu( 'primary' ) ) : ?>
  • src/wp-content/themes/twentyfifteen/single.php

     
    3838                                        '<span class="post-title">%title</span>',
    3939                        ) );
    4040
    41                 // End the loop.
     41                        // End the loop.
    4242                endwhile;
    4343                ?>
    4444
  • src/wp-content/themes/twentyfourteen/archive.php

     
    2727                        <header class="page-header">
    2828                                <h1 class="page-title">
    2929                                        <?php
    30                                                 if ( is_day() ) :
    31                                                         printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() );
     30                                        if ( is_day() ) :
     31                                                printf( __( 'Daily Archives: %s', 'twentyfourteen' ), get_the_date() );
    3232
    3333                                                elseif ( is_month() ) :
    3434                                                        printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfourteen' ) ) );
     
    4646
    4747                        <?php
    4848                                        // Start the Loop.
    49                                         while ( have_posts() ) : the_post();
     49                        while ( have_posts() ) : the_post();
    5050
    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() );
     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() );
    5757
    5858                                        endwhile;
    5959                                        // Previous/next page navigation.
  • src/wp-content/themes/twentyfourteen/author.php

     
    4545                                        rewind_posts();
    4646
    4747                                        // Start the Loop.
    48                                         while ( have_posts() ) : the_post();
     48                        while ( have_posts() ) : the_post();
    4949
    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() );
     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() );
    5656
    5757                                        endwhile;
    5858                                        // Previous/next page navigation.
  • src/wp-content/themes/twentyfourteen/category.php

     
    2222                                <?php
    2323                                        // Show an optional term description.
    2424                                        $term_description = term_description();
    25                                         if ( ! empty( $term_description ) ) :
    26                                                 printf( '<div class="taxonomy-description">%s</div>', $term_description );
     25                                if ( ! empty( $term_description ) ) :
     26                                        printf( '<div class="taxonomy-description">%s</div>', $term_description );
    2727                                        endif;
    2828                                ?>
    2929                        </header><!-- .archive-header -->
    3030
    3131                        <?php
    3232                                        // Start the Loop.
    33                                         while ( have_posts() ) : the_post();
     33                        while ( have_posts() ) : the_post();
    3434
    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() );
     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() );
    4141
    4242                                        endwhile;
    4343                                        // Previous/next page navigation.
  • src/wp-content/themes/twentyfourteen/comments.php

     
    2525        <h2 class="comments-title">
    2626                <?php
    2727                        printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyfourteen' ),
    28                                 number_format_i18n( get_comments_number() ), get_the_title() );
     28                        number_format_i18n( get_comments_number() ), get_the_title() );
    2929                ?>
    3030        </h2>
    3131
  • src/wp-content/themes/twentyfourteen/content-aside.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-audio.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-featured-post.php

     
    1212        <a class="post-thumbnail" href="<?php the_permalink(); ?>">
    1313        <?php
    1414                // Output the featured image.
    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                         }
     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                }
    2121                endif;
    2222        ?>
    2323        </a>
  • src/wp-content/themes/twentyfourteen/content-gallery.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-image.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-link.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-quote.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content-video.php

     
    1919                <?php
    2020                        endif;
    2121
    22                         if ( is_single() ) :
    23                                 the_title( '<h1 class="entry-title">', '</h1>' );
     22if ( is_single() ) :
     23        the_title( '<h1 class="entry-title">', '</h1>' );
    2424                        else :
    2525                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2626                        endif;
  • src/wp-content/themes/twentyfourteen/content.php

     
    2121                <?php
    2222                        endif;
    2323
    24                         if ( is_single() ) :
    25                                 the_title( '<h1 class="entry-title">', '</h1>' );
     24if ( is_single() ) :
     25        the_title( '<h1 class="entry-title">', '</h1>' );
    2626                        else :
    2727                                the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    2828                        endif;
     
    3030
    3131                <div class="entry-meta">
    3232                        <?php
    33                                 if ( 'post' == get_post_type() )
    34                                         twentyfourteen_posted_on();
     33                        if ( 'post' == get_post_type() ) {
     34                                twentyfourteen_posted_on();
     35                        }
    3536
    36                                 if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
     37                        if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
    3738                        ?>
    3839                        <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    3940                        <?php
  • src/wp-content/themes/twentyfourteen/featured-content.php

     
    1919                do_action( 'twentyfourteen_featured_posts_before' );
    2020
    2121                $featured_posts = twentyfourteen_get_featured_posts();
    22                 foreach ( (array) $featured_posts as $order => $post ) :
    23                         setup_postdata( $post );
     22        foreach ( (array) $featured_posts as $order => $post ) :
     23                setup_postdata( $post );
    2424
    25                         // Include the featured content template.
    26                         get_template_part( 'content', 'featured-post' );
     25                // Include the featured content template.
     26                get_template_part( 'content', 'featured-post' );
    2727                endforeach;
    2828
    2929                /**
  • src/wp-content/themes/twentyfourteen/footer.php

     
    2525
    2626        <?php wp_footer(); ?>
    2727</body>
    28 </html>
    29  No newline at end of file
     28</html>
  • src/wp-content/themes/twentyfourteen/functions.php

     
    4444}
    4545
    4646if ( ! function_exists( 'twentyfourteen_setup' ) ) :
    47 /**
     47        /**
    4848 * Twenty Fourteen setup.
    4949 *
    5050 * Set up theme defaults and registers support for various WordPress features.
     
    5555 *
    5656 * @since Twenty Fourteen 1.0
    5757 */
    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() {
    9459
    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                ) );
    10286
    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                        ) );
    113123
    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' );
    116126
    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        }
    120130endif; // twentyfourteen_setup
    121131add_action( 'after_setup_theme', 'twentyfourteen_setup' );
    122132
     
    259269                wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true );
    260270                wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array(
    261271                        'prevText' => __( 'Previous', 'twentyfourteen' ),
    262                         'nextText' => __( 'Next', 'twentyfourteen' )
     272                        'nextText' => __( 'Next', 'twentyfourteen' ),
    263273                ) );
    264274        }
    265275
     
    303313add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 );
    304314
    305315if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) :
    306 /**
     316        /**
    307317 * Print the attached image with a link to the next attached image.
    308318 *
    309319 * @since Twenty Fourteen 1.0
    310320 */
    311 function twentyfourteen_the_attached_image() {
    312         $post                = get_post();
    313         /**
     321        function twentyfourteen_the_attached_image() {
     322                $post                = get_post();
     323                /**
    314324         * Filter the default Twenty Fourteen attachment size.
    315325         *
    316326         * @since Twenty Fourteen 1.0
     
    322332         *     @type int $width  Width of the image in pixels. Default 810.
    323333         * }
    324334         */
    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();
    327337
    328         /*
    329         * Grab the IDs of all the image attachments in a gallery so we can get the URL
    330         * of the next adjacent image in a gallery, or the first image (if we're
    331         * looking at the last image in a gallery), or, in a gallery of one, just the
    332         * 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                ) );
    344354
    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                                }
    351362                        }
    352                 }
    353363
    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                        }
    357371                }
    358372
    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                        );
    363377        }
    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 }
    370378endif;
    371379
    372380if ( ! function_exists( 'twentyfourteen_list_authors' ) ) :
    373 /**
     381        /**
    374382 * Print a list of all site contributors who published at least one post.
    375383 *
    376384 * @since Twenty Fourteen 1.0
    377385 */
    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                ) );
    385393
    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 );
    388396
    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                        ?>
    394402
    395         <div class="contributor">
    396                 <div class="contributor-info">
     403                        <div class="contributor">
     404                        <div class="contributor-info">
    397405                        <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
    398406                        <div class="contributor-summary">
    399407                                <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
    400408                                <p class="contributor-bio">
    401                                         <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
     409                                <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
    402410                                </p>
    403411                                <a class="button contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
    404                                         <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
     412                                <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
    405413                                </a>
    406414                        </div><!-- .contributor-summary -->
    407                 </div><!-- .contributor-info -->
    408         </div><!-- .contributor -->
     415                        </div><!-- .contributor-info -->
     416                </div><!-- .contributor -->
    409417
    410         <?php
    411         endforeach;
    412 }
     418                <?php
     419                endforeach;
     420        }
    413421endif;
    414422
    415423/**
     
    553561 * `is_customize_preview` function was introduced.
    554562 */
    555563if ( ! function_exists( 'is_customize_preview' ) ) :
    556 function is_customize_preview() {
    557         global $wp_customize;
     564        function is_customize_preview() {
     565                global $wp_customize;
    558566
    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        }
    561569endif;
  • src/wp-content/themes/twentyfourteen/image.php

     
    1818
    1919        <?php
    2020                // Start the Loop.
    21                 while ( have_posts() ) : the_post();
     21        while ( have_posts() ) : the_post();
    2222        ?>
    23                         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    24                                 <header class="entry-header">
    25                                         <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
     23        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     24                <header class="entry-header">
     25                        <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    2626
    27                                         <div class="entry-meta">
     27                        <div class="entry-meta">
    2828
    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>
     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>
    3030
    31                                                 <span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> &times; <?php echo esc_html( $metadata['height'] ); ?></a></span>
     31                                <span class="full-size-link"><a href="<?php echo esc_url( wp_get_attachment_url() ); ?>"><?php echo esc_html( $metadata['width'] ); ?> &times; <?php echo esc_html( $metadata['height'] ); ?></a></span>
    3232
    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 -->
     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 -->
    3737
    38                                 <div class="entry-content">
    39                                         <div class="entry-attachment">
    40                                                 <div class="attachment">
    41                                                         <?php twentyfourteen_the_attached_image(); ?>
    42                                                 </div><!-- .attachment -->
     38                <div class="entry-content">
     39                        <div class="entry-attachment">
     40                                <div class="attachment">
     41                                        <?php twentyfourteen_the_attached_image(); ?>
     42                                </div><!-- .attachment -->
    4343
    44                                                 <?php if ( has_excerpt() ) : ?>
     44                                <?php if ( has_excerpt() ) : ?>
    4545                                                <div class="entry-caption">
    4646                                                        <?php the_excerpt(); ?>
    4747                                                </div><!-- .entry-caption -->
    4848                                                <?php endif; ?>
    49                                         </div><!-- .entry-attachment -->
     49                        </div><!-- .entry-attachment -->
    5050
    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 -->
     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 -->
    6161                        </article><!-- #post-## -->
    6262
    6363                        <nav id="image-navigation" class="navigation image-navigation">
    64                                 <div class="nav-links">
    65                                 <?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?>
     64                        <div class="nav-links">
     65                        <?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', 'twentyfourteen' ) . '</div>' ); ?>
    6666                                <?php next_image_link( false, '<div class="next-image">' . __( 'Next Image', 'twentyfourteen' ) . '</div>' ); ?>
    6767                                </div><!-- .nav-links -->
    6868                        </nav><!-- #image-navigation -->
  • src/wp-content/themes/twentyfourteen/inc/custom-header.php

     
    4848add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' );
    4949
    5050if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
    51 /**
     51        /**
    5252 * Styles the header image and text displayed on the blog
    5353 *
    5454 * @see twentyfourteen_custom_header_setup().
    5555 *
    5656 */
    57 function twentyfourteen_header_style() {
    58         $text_color = get_header_textcolor();
     57        function twentyfourteen_header_style() {
     58                $text_color = get_header_textcolor();
    5959
    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                }
    6364
    64         // If we get this far, we have custom styles.
    65         ?>
    66         <style type="text/css" id="twentyfourteen-header-css">
    67         <?php
     65                // If we get this far, we have custom styles.
     66                ?>
     67                <style type="text/css" id="twentyfourteen-header-css">
     68                <?php
    6869                // Has the text been hidden?
    6970                if ( ! display_header_text() ) :
    7071        ?>
     
    8485        <?php endif; ?>
    8586        </style>
    8687        <?php
    87 }
     88        }
    8889endif; // twentyfourteen_header_style
    8990
    9091
    9192if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) :
    92 /**
     93        /**
    9394 * Style the header image displayed on the Appearance > Header screen.
    9495 *
    9596 * @see twentyfourteen_custom_header_setup()
    9697 *
    9798 * @since Twenty Fourteen 1.0
    9899 */
    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 {
    103104                background-color: #000;
    104105                border: none;
    105106                max-width: 1260px;
    106107                min-height: 48px;
    107         }
    108         #headimg h1 {
     108                }
     109                #headimg h1 {
    109110                font-family: Lato, sans-serif;
    110111                font-size: 18px;
    111112                line-height: 48px;
    112113                margin: 0 0 0 30px;
    113         }
    114         .rtl #headimg h1  {
     114                }
     115                .rtl #headimg h1  {
    115116                margin: 0 30px 0 0;
    116         }
    117         #headimg h1 a {
     117                }
     118                #headimg h1 a {
    118119                color: #fff;
    119120                text-decoration: none;
    120         }
    121         #headimg img {
     121                }
     122                #headimg img {
    122123                vertical-align: middle;
     124                }
     125                </style>
     126                <?php
    123127        }
    124         </style>
    125 <?php
    126 }
    127128endif; // twentyfourteen_admin_header_style
    128129
    129130if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) :
    130 /**
     131        /**
    131132 * Create the custom header image markup displayed on the Appearance > Header screen.
    132133 *
    133134 * @see twentyfourteen_custom_header_setup()
    134135 *
    135136 * @since Twenty Fourteen 1.0
    136137 */
    137 function twentyfourteen_admin_header_image() {
    138 ?>
    139         <div id="headimg">
     138        function twentyfourteen_admin_header_image() {
     139                ?>
     140                <div id="headimg">
    140141                <?php if ( get_header_image() ) : ?>
    141142                <img src="<?php header_image(); ?>" alt="">
    142143                <?php endif; ?>
    143144                <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>
    144145        </div>
    145 <?php
    146 }
     146        <?php
     147        }
    147148endif; // twentyfourteen_admin_header_image
  • src/wp-content/themes/twentyfourteen/inc/featured-content.php

     
    8383                        self::$max_posts = absint( $theme_support[0]['max_posts'] );
    8484                }
    8585
    86                 add_filter( $filter,                              array( __CLASS__, 'get_featured_posts' )    );
     86                add_filter( $filter,                              array( __CLASS__, 'get_featured_posts' ) );
    8787                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' ) );
    9595        }
    9696
    9797        /**
     
    106106         */
    107107        public static function wp_loaded() {
    108108                if ( self::get_setting( 'hide-tag' ) ) {
    109                         add_filter( 'get_terms',     array( __CLASS__, 'hide_featured_term'     ), 10, 3 );
     109                        add_filter( 'get_terms',     array( __CLASS__, 'hide_featured_term' ), 10, 3 );
    110110                        add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 );
    111111                }
    112112        }
  • src/wp-content/themes/twentyfourteen/inc/template-tags.php

     
    88 */
    99
    1010if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) :
    11 /**
     11        /**
    1212 * Display navigation to next/previous set of posts when applicable.
    1313 *
    1414 * @since Twenty Fourteen 1.0
     
    1616 * @global WP_Query   $wp_query   WordPress Query object.
    1717 * @global WP_Rewrite $wp_rewrite WordPress Rewrite object.
    1818 */
    19 function twentyfourteen_paging_nav() {
    20         global $wp_query, $wp_rewrite;
     19        function twentyfourteen_paging_nav() {
     20                global $wp_query, $wp_rewrite;
    2121
    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' => __( '&larr; Previous', 'twentyfourteen' ),
    51                 'next_text' => __( 'Next &rarr;', '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                }
    5326
    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 );
    5531
    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' => __( '&larr; Previous', 'twentyfourteen' ),
     51                        'next_text' => __( 'Next &rarr;', '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">
    6060                        <?php echo $links; ?>
    61                 </div><!-- .pagination -->
    62         </nav><!-- .navigation -->
    63         <?php
    64         endif;
    65 }
     61                        </div><!-- .pagination -->
     62                </nav><!-- .navigation -->
     63                <?php
     64                endif;
     65        }
    6666endif;
    6767
    6868if ( ! function_exists( 'twentyfourteen_post_nav' ) ) :
    69 /**
     69        /**
    7070 * Display navigation to next/previous post when applicable.
    7171 *
    7272 * @since Twenty Fourteen 1.0
    7373 */
    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 );
    7878
    79         if ( ! $next && ! $previous ) {
    80                 return;
    81         }
     79                if ( ! $next && ! $previous ) {
     80                        return;
     81                }
    8282
    83         ?>
    84         <nav class="navigation post-navigation" role="navigation">
     83                ?>
     84                <nav class="navigation post-navigation" role="navigation">
    8585                <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1>
    8686                <div class="nav-links">
    8787                        <?php
    8888                        if ( is_attachment() ) :
    8989                                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         <?php
    98 }
     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        }
    9999endif;
    100100
    101101if ( ! function_exists( 'twentyfourteen_posted_on' ) ) :
    102 /**
     102        /**
    103103 * Print HTML with meta information for the current post-date/time and author.
    104104 *
    105105 * @since Twenty Fourteen 1.0
    106106 */
    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                }
    111111
    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        }
    121121endif;
    122122
    123123/**
     
    162162add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
    163163
    164164if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) :
    165 /**
     165        /**
    166166 * Display an optional post thumbnail.
    167167 *
    168168 * Wraps the post thumbnail in an anchor element on index
     
    171171 * @since Twenty Fourteen 1.0
    172172 * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable.
    173173 */
    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                }
    178178
    179         if ( is_singular() ) :
    180         ?>
     179                if ( is_singular() ) :
     180                ?>
    181181
    182         <div class="post-thumbnail">
    183         <?php
     182                <div class="post-thumbnail">
     183                <?php
    184184                if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) ) {
    185185                        the_post_thumbnail( 'twentyfourteen-full-width' );
    186186                } else {
    187187                        the_post_thumbnail();
    188188                }
    189         ?>
    190         </div>
     189                ?>
     190                </div>
    191191
    192         <?php else : ?>
     192                <?php else : ?>
    193193
    194194        <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
    195195        <?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        }
    201203        ?>
    202204        </a>
    203205
    204206        <?php endif; // End is_singular()
    205 }
     207        }
    206208endif;
    207209
    208210if ( ! function_exists( 'twentyfourteen_excerpt_more' ) && ! is_admin() ) :
    209 /**
     211        /**
    210212 * Replaces "[...]" (appended to automatically generated excerpts) with ...
    211213 * and a Continue reading link.
    212214 *
     
    215217 * @param string $more Default Read More excerpt link.
    216218 * @return string Filtered Read More excerpt link.
    217219 */
    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() ) ),
    221223                        /* translators: %s: Name of current post */
    222224                        sprintf( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
    223225                );
    224         return ' &hellip; ' . $link;
    225 }
    226 add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' );
     226                        return ' &hellip; ' . $link;
     227        }
     228        add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' );
    227229endif;
  • src/wp-content/themes/twentyfourteen/inc/widgets.php

     
    133133                        <ol>
    134134
    135135                                <?php
    136                                         while ( $ephemera->have_posts() ) :
    137                                                 $ephemera->the_post();
    138                                                 $tmp_more = $GLOBALS['more'];
    139                                                 $GLOBALS['more'] = 0;
     136                                while ( $ephemera->have_posts() ) :
     137                                        $ephemera->the_post();
     138                                        $tmp_more = $GLOBALS['more'];
     139                                        $GLOBALS['more'] = 0;
    140140                                ?>
    141141                                <li>
    142142                                <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">&rarr;</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;
    146168
    147                                                                 if ( post_password_required() ) :
    148                                                                         the_content( __( 'Continue reading <span class="meta-nav">&rarr;</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 );
    176170
    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 ) ) :
    178179                                                ?>
    179180                                                <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a>
    180181                                                <?php endif; ?>
    181182                                                <p class="wp-caption-text">
    182                                                         <?php
    183                                                                 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' ),