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' ),
    184                                                                         esc_url( get_permalink() ),
    185                                                                         number_format_i18n( $total_images )
    186                                                                 );
    187                                                         ?>
    188                                                 </p>
    189                                                 <?php
    190                                                                 endif;
     183                                        <?php
     184                                                printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
     185                                                        esc_url( get_permalink() ),
     186                                                        number_format_i18n( $total_images )
     187                                                );
     188                                        ?>
     189                                </p>
     190                                <?php
     191                                endif;
    191192
    192                                                         else :
    193                                                                 the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
     193                                                else :
     194                                                        the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
    194195                                                        endif;
    195196                                                ?>
    196197                                        </div><!-- .entry-content -->
    197198
    198199                                        <header class="entry-header">
    199200                                                <div class="entry-meta">
    200                                                         <?php
    201                                                                 if ( ! has_post_format( 'link' ) ) :
    202                                                                         the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    203                                                                 endif;
    204 
    205                                                                 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>',
    206                                                                         esc_url( get_permalink() ),
    207                                                                         esc_attr( get_the_date( 'c' ) ),
    208                                                                         esc_html( get_the_date() ),
    209                                                                         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    210                                                                         get_the_author()
    211                                                                 );
    212 
    213                                                                 if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
    214                                                         ?>
    215                                                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
     201                                                <?php
     202                                                if ( ! has_post_format( 'link' ) ) :
     203                                                        the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
     204                                                        endif;
     205
     206                                                printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
     207                                                        esc_url( get_permalink() ),
     208                                                        esc_attr( get_the_date( 'c' ) ),
     209                                                        esc_html( get_the_date() ),
     210                                                        esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     211                                                        get_the_author()
     212                                                );
     213
     214                                                if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
     215                                                ?>
     216                                                <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    216217                                                        <?php endif; ?>
    217218                                                </div><!-- .entry-meta -->
    218219                                        </header><!-- .entry-header -->
  • src/wp-content/themes/twentyfourteen/index.php

     
    1919<div id="main-content" class="main-content">
    2020
    2121<?php
    22         if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    23                 // Include the featured content template.
    24                 get_template_part( 'featured-content' );
    25         }
     22if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     23        // Include the featured content template.
     24        get_template_part( 'featured-content' );
     25}
    2626?>
    2727
    2828        <div id="primary" class="content-area">
    2929                <div id="content" class="site-content" role="main">
    3030
    3131                <?php
    32                         if ( have_posts() ) :
    33                                 // Start the Loop.
    34                                 while ( have_posts() ) : the_post();
    35 
    36                                         /*
    37                                         * Include the post format-specific template for the content. If you want to
    38                                         * use this in a child theme, then include a file called called content-___.php
    39                                         * (where ___ is the post format) and that will be used instead.
    40                                         */
    41                                         get_template_part( 'content', get_post_format() );
     32                if ( have_posts() ) :
     33                        // Start the Loop.
     34                        while ( have_posts() ) : the_post();
     35
     36                                /*
     37                                * Include the post format-specific template for the content. If you want to
     38                                * use this in a child theme, then include a file called called content-___.php
     39                                * (where ___ is the post format) and that will be used instead.
     40                                */
     41                                get_template_part( 'content', get_post_format() );
    4242
    4343                                endwhile;
    44                                 // Previous/next post navigation.
    45                                 twentyfourteen_paging_nav();
     44                        // Previous/next post navigation.
     45                        twentyfourteen_paging_nav();
    4646
    4747                        else :
    4848                                // If no content, include the "No posts found" template.
  • src/wp-content/themes/twentyfourteen/page-templates/contributors.php

     
    1212<div id="main-content" class="main-content">
    1313
    1414<?php
    15         if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    16                 // Include the featured content template.
    17                 get_template_part( 'featured-content' );
    18         }
     15if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16        // Include the featured content template.
     17        get_template_part( 'featured-content' );
     18}
    1919?>
    2020
    2121        <div id="primary" class="content-area">
    2222                <div id="content" class="site-content" role="main">
    2323                        <?php
    2424                                // Start the Loop.
    25                                 while ( have_posts() ) : the_post();
     25                        while ( have_posts() ) : the_post();
    2626                        ?>
    2727
    2828                        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    29                                 <?php
    30                                         the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
     29                        <?php
     30                        the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
    3131
    32                                         // Output the authors list.
    33                                         twentyfourteen_list_authors();
     32                        // Output the authors list.
     33                        twentyfourteen_list_authors();
    3434
    35                                         edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' );
    36                                 ?>
     35                        edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' );
     36                        ?>
    3737                        </article><!-- #post-## -->
    3838
    3939                        <?php
    40                                         // If comments are open or we have at least one comment, load up the comment template.
    41                                         if ( comments_open() || get_comments_number() ) {
    42                                                 comments_template();
    43                                         }
     40                        // If comments are open or we have at least one comment, load up the comment template.
     41                        if ( comments_open() || get_comments_number() ) {
     42                                comments_template();
     43                        }
    4444                                endwhile;
    4545                        ?>
    4646                </div><!-- #content -->
  • src/wp-content/themes/twentyfourteen/page-templates/full-width.php

     
    1212<div id="main-content" class="main-content">
    1313
    1414<?php
    15         if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    16                 // Include the featured content template.
    17                 get_template_part( 'featured-content' );
    18         }
     15if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     16        // Include the featured content template.
     17        get_template_part( 'featured-content' );
     18}
    1919?>
    2020
    2121        <div id="primary" class="content-area">
    2222                <div id="content" class="site-content" role="main">
    2323                        <?php
    2424                                // Start the Loop.
    25                                 while ( have_posts() ) : the_post();
     25                        while ( have_posts() ) : the_post();
    2626
    27                                         // Include the page content template.
    28                                         get_template_part( 'content', 'page' );
     27                                // Include the page content template.
     28                                get_template_part( 'content', 'page' );
    2929
    30                                         // If comments are open or we have at least one comment, load up the comment template.
    31                                         if ( comments_open() || get_comments_number() ) {
    32                                                 comments_template();
    33                                         }
     30                                // If comments are open or we have at least one comment, load up the comment template.
     31                                if ( comments_open() || get_comments_number() ) {
     32                                        comments_template();
     33                                }
    3434                                endwhile;
    3535                        ?>
    3636                </div><!-- #content -->
  • src/wp-content/themes/twentyfourteen/page.php

     
    1616<div id="main-content" class="main-content">
    1717
    1818<?php
    19         if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    20                 // Include the featured content template.
    21                 get_template_part( 'featured-content' );
    22         }
     19if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
     20        // Include the featured content template.
     21        get_template_part( 'featured-content' );
     22}
    2323?>
    2424        <div id="primary" class="content-area">
    2525                <div id="content" class="site-content" role="main">
    2626
    2727                        <?php
    2828                                // Start the Loop.
    29                                 while ( have_posts() ) : the_post();
     29                        while ( have_posts() ) : the_post();
    3030
    31                                         // Include the page content template.
    32                                         get_template_part( 'content', 'page' );
     31                                // Include the page content template.
     32                                get_template_part( 'content', 'page' );
    3333
    34                                         // If comments are open or we have at least one comment, load up the comment template.
    35                                         if ( comments_open() || get_comments_number() ) {
    36                                                 comments_template();
    37                                         }
     34                                // If comments are open or we have at least one comment, load up the comment template.
     35                                if ( comments_open() || get_comments_number() ) {
     36                                        comments_template();
     37                                }
    3838                                endwhile;
    3939                        ?>
    4040
  • src/wp-content/themes/twentyfourteen/search.php

     
    2020
    2121                                <?php
    2222                                        // Start the Loop.
    23                                         while ( have_posts() ) : the_post();
     23                                while ( have_posts() ) : the_post();
    2424
    25                                                 /*
    26                                                  * Include the post format-specific template for the content. If you want to
    27                                                  * use this in a child theme, then include a file called called content-___.php
    28                                                  * (where ___ is the post format) and that will be used instead.
    29                                                  */
    30                                                 get_template_part( 'content', get_post_format() );
     25                                        /*
     26                                        * Include the post format-specific template for the content. If you want to
     27                                        * use this in a child theme, then include a file called called content-___.php
     28                                        * (where ___ is the post format) and that will be used instead.
     29                                        */
     30                                        get_template_part( 'content', get_post_format() );
    3131
    3232                                        endwhile;
    3333                                        // Previous/next post navigation.
  • src/wp-content/themes/twentyfourteen/sidebar.php

     
    1010<div id="secondary">
    1111        <?php
    1212                $description = get_bloginfo( 'description', 'display' );
    13                 if ( ! empty ( $description ) ) :
     13        if ( ! empty( $description ) ) :
    1414        ?>
    1515        <h2 class="site-description"><?php echo esc_html( $description ); ?></h2>
    1616        <?php endif; ?>
    1717
    1818        <?php if ( has_nav_menu( 'secondary' ) ) : ?>
    1919        <nav role="navigation" class="navigation site-navigation secondary-navigation">
    20                 <?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
     20                <?php wp_nav_menu( array(
     21                        'theme_location' => 'secondary',
     22                ) ); ?>
    2123        </nav>
    2224        <?php endif; ?>
    2325
  • src/wp-content/themes/twentyfourteen/single.php

     
    1313                <div id="content" class="site-content" role="main">
    1414                        <?php
    1515                                // Start the Loop.
    16                                 while ( have_posts() ) : the_post();
     16                        while ( have_posts() ) : the_post();
    1717
    18                                         /*
    19                                          * Include the post format-specific template for the content. If you want to
    20                                          * use this in a child theme, then include a file called called content-___.php
    21                                          * (where ___ is the post format) and that will be used instead.
    22                                          */
    23                                         get_template_part( 'content', get_post_format() );
     18                                /*
     19                                * Include the post format-specific template for the content. If you want to
     20                                * use this in a child theme, then include a file called called content-___.php
     21                                * (where ___ is the post format) and that will be used instead.
     22                                */
     23                                get_template_part( 'content', get_post_format() );
    2424
    25                                         // Previous/next post navigation.
    26                                         twentyfourteen_post_nav();
     25                                // Previous/next post navigation.
     26                                twentyfourteen_post_nav();
    2727
    28                                         // If comments are open or we have at least one comment, load up the comment template.
    29                                         if ( comments_open() || get_comments_number() ) {
    30                                                 comments_template();
    31                                         }
     28                                // If comments are open or we have at least one comment, load up the comment template.
     29                                if ( comments_open() || get_comments_number() ) {
     30                                        comments_template();
     31                                }
    3232                                endwhile;
    3333                        ?>
    3434                </div><!-- #content -->
  • src/wp-content/themes/twentyfourteen/tag.php

     
    2424                                <?php
    2525                                        // Show an optional term description.
    2626                                        $term_description = term_description();
    27                                         if ( ! empty( $term_description ) ) :
    28                                                 printf( '<div class="taxonomy-description">%s</div>', $term_description );
     27                                if ( ! empty( $term_description ) ) :
     28                                        printf( '<div class="taxonomy-description">%s</div>', $term_description );
    2929                                        endif;
    3030                                ?>
    3131                        </header><!-- .archive-header -->
    3232
    3333                        <?php
    3434                                        // Start the Loop.
    35                                         while ( have_posts() ) : the_post();
     35                        while ( have_posts() ) : the_post();
    3636
    37                                                 /*
    38                                                  * Include the post format-specific template for the content. If you want to
    39                                                  * use this in a child theme, then include a file called called content-___.php
    40                                                  * (where ___ is the post format) and that will be used instead.
    41                                                  */
    42                                                 get_template_part( 'content', get_post_format() );
     37                                /*
     38                                * Include the post format-specific template for the content. If you want to
     39                                * use this in a child theme, then include a file called called content-___.php
     40                                * (where ___ is the post format) and that will be used instead.
     41                                */
     42                                get_template_part( 'content', get_post_format() );
    4343
    4444                                        endwhile;
    4545                                        // Previous/next page navigation.
  • src/wp-content/themes/twentyfourteen/taxonomy-post_format.php

     
    2626                        <header class="archive-header">
    2727                                <h1 class="archive-title">
    2828                                        <?php
    29                                                 if ( is_tax( 'post_format', 'post-format-aside' ) ) :
    30                                                         _e( 'Asides', 'twentyfourteen' );
     29                                        if ( is_tax( 'post_format', 'post-format-aside' ) ) :
     30                                                _e( 'Asides', 'twentyfourteen' );
    3131
    3232                                                elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
    3333                                                        _e( 'Images', 'twentyfourteen' );
     
    5757
    5858                        <?php
    5959                                        // Start the Loop.
    60                                         while ( have_posts() ) : the_post();
     60                        while ( have_posts() ) : the_post();
    6161
    62                                                 /*
    63                                                  * Include the post format-specific template for the content. If you want to
    64                                                  * use this in a child theme, then include a file called called content-___.php
    65                                                  * (where ___ is the post format) and that will be used instead.
    66                                                  */
    67                                                 get_template_part( 'content', get_post_format() );
     62                                /*
     63                                * Include the post format-specific template for the content. If you want to
     64                                * use this in a child theme, then include a file called called content-___.php
     65                                * (where ___ is the post format) and that will be used instead.
     66                                */
     67                                get_template_part( 'content', get_post_format() );
    6868
    6969                                        endwhile;
    7070                                        // Previous/next page navigation.
  • src/wp-content/themes/twentyseventeen/archive.php

     
    4242                        endwhile;
    4343
    4444                        the_posts_pagination( array(
    45                                 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
    46                                 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
     45                                'prev_text' => twentyseventeen_get_svg( array(
     46                                        'icon' => 'arrow-left',
     47                                ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
     48                                'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array(
     49                                        'icon' => 'arrow-right',
     50                                ) ),
    4751                                'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
    4852                        ) );
    4953
  • src/wp-content/themes/twentyseventeen/comments.php

     
    5757                                        'avatar_size' => 100,
    5858                                        'style'       => 'ol',
    5959                                        'short_ping'  => true,
    60                                         'reply_text'  => twentyseventeen_get_svg( array( 'icon' => 'mail-reply' ) ) . __( 'Reply', 'twentyseventeen' ),
     60                                        'reply_text'  => twentyseventeen_get_svg( array(
     61                                                'icon' => 'mail-reply',
     62                                        ) ) . __( 'Reply', 'twentyseventeen' ),
    6163                                ) );
    6264                        ?>
    6365                </ol>
  • src/wp-content/themes/twentyseventeen/inc/custom-header.php

     
    5353add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' );
    5454
    5555if ( ! function_exists( 'twentyseventeen_header_style' ) ) :
    56 /**
     56        /**
    5757 * Styles the header image and text displayed on the blog.
    5858 *
    5959 * @see twentyseventeen_custom_header_setup().
    6060 */
    61 function twentyseventeen_header_style() {
    62         $header_text_color = get_header_textcolor();
     61        function twentyseventeen_header_style() {
     62                $header_text_color = get_header_textcolor();
    6363
    64         // If no custom options for text are set, let's bail.
    65         // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.
    66         if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
    67                 return;
    68         }
     64                // If no custom options for text are set, let's bail.
     65                // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.
     66                if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
     67                        return;
     68                }
    6969
    70         // If we get this far, we have custom styles. Let's do this.
    71         ?>
    72         <style id="twentyseventeen-custom-header-styles" type="text/css">
    73         <?php
     70                // If we get this far, we have custom styles. Let's do this.
     71                ?>
     72                <style id="twentyseventeen-custom-header-styles" type="text/css">
     73                <?php
    7474                // Has the text been hidden?
    7575                if ( 'blank' === $header_text_color ) :
    7676        ?>
     
    106106        <?php endif; ?>
    107107        </style>
    108108        <?php
    109 }
     109        }
    110110endif; // End of twentyseventeen_header_style.
    111111
    112112/**
     
    115115 * @param array $settings Video settings.
    116116 */
    117117function twentyseventeen_video_controls( $settings ) {
    118         $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'play' ) );
    119         $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'pause' ) );
     118        $settings['l10n']['play'] = '<span class="screen-reader-text">' . __( 'Play background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array(
     119                'icon' => 'play',
     120        ) );
     121        $settings['l10n']['pause'] = '<span class="screen-reader-text">' . __( 'Pause background video', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array(
     122                'icon' => 'pause',
     123        ) );
    120124        return $settings;
    121125}
    122126add_filter( 'header_video_settings', 'twentyseventeen_video_controls' );
  • src/wp-content/themes/twentyseventeen/inc/template-tags.php

     
    1010 */
    1111
    1212if ( ! function_exists( 'twentyseventeen_posted_on' ) ) :
    13 /**
     13        /**
    1414 * Prints HTML with meta information for the current post-date/time and author.
    1515 */
    16 function twentyseventeen_posted_on() {
     16        function twentyseventeen_posted_on() {
    1717
    18         // Get the author name; wrap it in a link.
    19         $byline = sprintf(
    20                 /* translators: %s: post author */
    21                 __( 'by %s', 'twentyseventeen' ),
    22                 '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>'
    23         );
     18                // Get the author name; wrap it in a link.
     19                $byline = sprintf(
     20                        /* translators: %s: post author */
     21                        __( 'by %s', 'twentyseventeen' ),
     22                        '<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>'
     23                );
    2424
    25         // Finally, let's write all of this to the page.
    26         echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>';
    27 }
     25                        // Finally, let's write all of this to the page.
     26                        echo '<span class="posted-on">' . twentyseventeen_time_link() . '</span><span class="byline"> ' . $byline . '</span>';
     27        }
    2828endif;
    2929
    3030
    3131if ( ! function_exists( 'twentyseventeen_time_link' ) ) :
    32 /**
     32        /**
    3333 * Gets a nicely formatted string for the published date.
    3434 */
    35 function twentyseventeen_time_link() {
    36         $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    37         if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    38                 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    39         }
    40 
    41         $time_string = sprintf( $time_string,
    42                 get_the_date( DATE_W3C ),
    43                 get_the_date(),
    44                 get_the_modified_date( DATE_W3C ),
    45                 get_the_modified_date()
    46         );
    47 
    48         // Wrap the time string in a link, and preface it with 'Posted on'.
    49         return sprintf(
    50                 /* translators: %s: post date */
    51                 __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ),
    52                 '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
    53         );
    54 }
     35        function twentyseventeen_time_link() {
     36                $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     37                if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
     38                        $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     39                }
     40
     41                $time_string = sprintf( $time_string,
     42                        get_the_date( DATE_W3C ),
     43                        get_the_date(),
     44                        get_the_modified_date( DATE_W3C ),
     45                        get_the_modified_date()
     46                );
     47
     48                        // Wrap the time string in a link, and preface it with 'Posted on'.
     49                        return sprintf(
     50                                /* translators: %s: post date */
     51                                __( '<span class="screen-reader-text">Posted on</span> %s', 'twentyseventeen' ),
     52                                '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
     53                        );
     54        }
    5555endif;
    5656
    5757
    5858if ( ! function_exists( 'twentyseventeen_entry_footer' ) ) :
    59 /**
     59        /**
    6060 * Prints HTML with meta information for the categories, tags and comments.
    6161 */
    62 function twentyseventeen_entry_footer() {
     62        function twentyseventeen_entry_footer() {
    6363
    64         /* translators: used between list items, there is a space after the comma */
    65         $separate_meta = __( ', ', 'twentyseventeen' );
     64                /* translators: used between list items, there is a space after the comma */
     65                $separate_meta = __( ', ', 'twentyseventeen' );
    6666
    67         // Get Categories for posts.
    68         $categories_list = get_the_category_list( $separate_meta );
     67                // Get Categories for posts.
     68                $categories_list = get_the_category_list( $separate_meta );
    6969
    70         // Get Tags for posts.
    71         $tags_list = get_the_tag_list( '', $separate_meta );
     70                // Get Tags for posts.
     71                $tags_list = get_the_tag_list( '', $separate_meta );
    7272
    73         // We don't want to output .entry-footer if it will be empty, so make sure its not.
    74         if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {
     73                // We don't want to output .entry-footer if it will be empty, so make sure its not.
     74                if ( ( ( twentyseventeen_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {
    7575
    76                 echo '<footer class="entry-footer">';
     76                        echo '<footer class="entry-footer">';
    7777
    7878                        if ( 'post' === get_post_type() ) {
    7979                                if ( ( $categories_list && twentyseventeen_categorized_blog() ) || $tags_list ) {
    8080                                        echo '<span class="cat-tags-links">';
    8181
    8282                                                // Make sure there's more than one category before displaying.
    83                                                 if ( $categories_list && twentyseventeen_categorized_blog() ) {
    84                                                         echo '<span class="cat-links">' . twentyseventeen_get_svg( array( 'icon' => 'folder-open' ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>';
    85                                                 }
    86 
    87                                                 if ( $tags_list ) {
    88                                                         echo '<span class="tags-links">' . twentyseventeen_get_svg( array( 'icon' => 'hashtag' ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>';
    89                                                 }
     83                                        if ( $categories_list && twentyseventeen_categorized_blog() ) {
     84                                                echo '<span class="cat-links">' . twentyseventeen_get_svg( array(
     85                                                        'icon' => 'folder-open',
     86                                                ) ) . '<span class="screen-reader-text">' . __( 'Categories', 'twentyseventeen' ) . '</span>' . $categories_list . '</span>';
     87                                        }
     88
     89                                        if ( $tags_list ) {
     90                                                echo '<span class="tags-links">' . twentyseventeen_get_svg( array(
     91                                                        'icon' => 'hashtag',
     92                                                ) ) . '<span class="screen-reader-text">' . __( 'Tags', 'twentyseventeen' ) . '</span>' . $tags_list . '</span>';
     93                                        }
    9094
    9195                                        echo '</span>';
    9296                                }
     
    9498
    9599                        twentyseventeen_edit_link();
    96100
    97                 echo '</footer> <!-- .entry-footer -->';
     101                        echo '</footer> <!-- .entry-footer -->';
     102                }
    98103        }
    99 }
    100104endif;
    101105
    102106
    103107if ( ! function_exists( 'twentyseventeen_edit_link' ) ) :
    104 /**
     108        /**
    105109 * Returns an accessibility-friendly link to edit a post or page.
    106110 *
    107111 * This also gives us a little context about what exactly we're editing
     
    109113 * of the template hierarchy and their content. Helpful when/if the single-page
    110114 * layout with multiple posts/pages shown gets confusing.
    111115 */
    112 function twentyseventeen_edit_link() {
    113         edit_post_link(
    114                 sprintf(
    115                         /* translators: %s: Name of current post */
    116                         __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
    117                         get_the_title()
    118                 ),
    119                 '<span class="edit-link">',
    120                 '</span>'
    121         );
    122 }
     116        function twentyseventeen_edit_link() {
     117                edit_post_link(
     118                        sprintf(
     119                                /* translators: %s: Name of current post */
     120                                __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
     121                                get_the_title()
     122                        ),
     123                        '<span class="edit-link">',
     124                        '</span>'
     125                );
     126        }
    123127endif;
    124128
    125129/**
  • src/wp-content/themes/twentyseventeen/index.php

     
    4747                                endwhile;
    4848
    4949                                the_posts_pagination( array(
    50                                         'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
    51                                         'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ),
     50                                        'prev_text' => twentyseventeen_get_svg( array(
     51                                                'icon' => 'arrow-left',
     52                                        ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>',
     53                                        'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array(
     54                                                'icon' => 'arrow-right',
     55                                        ) ),
    5256                                        'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>',
    5357                                ) );
    5458
  • src/wp-content/themes/twentyseventeen/single.php

     
    2828                                endif;
    2929
    3030                                the_post_navigation( array(
    31                                         'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>',
     31                                        'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array(
     32                                                'icon' => 'arrow-left',
     33                                        ) ) . '</span>%title</span>',
    3234                                        'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>',
    3335                                ) );
    3436
  • src/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php

     
    1212<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'twentyseventeen' ); ?>">
    1313        <button class="menu-toggle" aria-controls="top-menu" aria-expanded="false">
    1414                <?php
    15                 echo twentyseventeen_get_svg( array( 'icon' => 'bars' ) );
    16                 echo twentyseventeen_get_svg( array( 'icon' => 'close' ) );
     15                echo twentyseventeen_get_svg( array(
     16                        'icon' => 'bars',
     17                ) );
     18                echo twentyseventeen_get_svg( array(
     19                        'icon' => 'close',
     20                ) );
    1721                _e( 'Menu', 'twentyseventeen' );
    1822                ?>
    1923        </button>
     
    2428        ) ); ?>
    2529
    2630        <?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?>
    27                 <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
     31                <a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array(
     32                        'icon' => 'arrow-right',
     33                ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
    2834        <?php endif; ?>
    2935</nav><!-- #site-navigation -->
  • src/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php

     
    4848
    4949                        <?php
    5050                        // Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int).
    51                         if ( get_the_ID() === (int) get_option( 'page_for_posts' )  ) : ?>
     51                        if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : ?>
    5252
    5353                                <?php // Show four most recent posts.
    5454                                $recent_posts = new WP_Query( array(
     
    5959                                ) );
    6060                                ?>
    6161
    62                                 <?php if ( $recent_posts->have_posts() ) : ?>
     62                                        <?php if ( $recent_posts->have_posts() ) : ?>
    6363
    6464                                        <div class="recent-posts">
    6565
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php

     
    1414
    1515<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1616        <?php
    17                 if ( is_sticky() && is_home() ) {
    18                         echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
    19                 }
     17        if ( is_sticky() && is_home() ) {
     18                echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
     19        }
    2020        ?>
    2121        <header class="entry-header">
    2222                <?php
    23                         if ( 'post' === get_post_type() ) {
    24                                 echo '<div class="entry-meta">';
    25                                         if ( is_single() ) {
    26                                                 twentyseventeen_posted_on();
    27                                         } else {
    28                                                 echo twentyseventeen_time_link();
    29                                                 twentyseventeen_edit_link();
    30                                         };
    31                                 echo '</div><!-- .entry-meta -->';
    32                         };
    33 
     23                if ( 'post' === get_post_type() ) {
     24                        echo '<div class="entry-meta">';
    3425                        if ( is_single() ) {
    35                                 the_title( '<h1 class="entry-title">', '</h1>' );
    36                         } elseif ( is_front_page() && is_home() ) {
    37                                 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     26                                twentyseventeen_posted_on();
    3827                        } else {
    39                                 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    40                         }
     28                                echo twentyseventeen_time_link();
     29                                twentyseventeen_edit_link();
     30                        };
     31                        echo '</div><!-- .entry-meta -->';
     32                };
     33
     34                if ( is_single() ) {
     35                        the_title( '<h1 class="entry-title">', '</h1>' );
     36                } elseif ( is_front_page() && is_home() ) {
     37                        the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     38                } else {
     39                        the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
     40                }
    4141                ?>
    4242        </header><!-- .entry-header -->
    4343
     
    4646                $audio = false;
    4747
    4848                // Only get audio from the content if a playlist isn't present.
    49                 if ( false === strpos( $content, 'wp-playlist-script' ) ) {
    50                         $audio = get_media_embedded_in_content( $content, array( 'audio' ) );
    51                 }
     49        if ( false === strpos( $content, 'wp-playlist-script' ) ) {
     50                $audio = get_media_embedded_in_content( $content, array( 'audio' ) );
     51        }
    5252
    5353        ?>
    5454
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php

     
    3434
    3535                        // The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
    3636                        the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
    37                 } else {
    38                         the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    39                 } ?>
     37} else {
     38        the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
     39} ?>
    4040        </header><!-- .entry-header -->
    4141
    4242        <div class="entry-summary">
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-gallery.php

     
    2222                <?php
    2323                if ( 'post' === get_post_type() ) {
    2424                        echo '<div class="entry-meta">';
    25                                 if ( is_single() ) {
    26                                         twentyseventeen_posted_on();
    27                                 } else {
    28                                         echo twentyseventeen_time_link();
    29                                         twentyseventeen_edit_link();
    30                                 };
     25                        if ( is_single() ) {
     26                                twentyseventeen_posted_on();
     27                        } else {
     28                                echo twentyseventeen_time_link();
     29                                twentyseventeen_edit_link();
     30                        };
    3131                        echo '</div><!-- .entry-meta -->';
    3232                };
    3333
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-image.php

     
    1414
    1515<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1616        <?php
    17                 if ( is_sticky() && is_home() ) {
    18                         echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
    19                 }
     17        if ( is_sticky() && is_home() ) {
     18                echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
     19        }
    2020        ?>
    2121        <header class="entry-header">
    2222                <?php
    23                         if ( 'post' === get_post_type() ) {
    24                                 echo '<div class="entry-meta">';
    25                                         if ( is_single() ) {
    26                                                 twentyseventeen_posted_on();
    27                                         } else {
    28                                                 echo twentyseventeen_time_link();
    29                                                 twentyseventeen_edit_link();
    30                                         };
    31                                 echo '</div><!-- .entry-meta -->';
    32                         };
    33 
     23                if ( 'post' === get_post_type() ) {
     24                        echo '<div class="entry-meta">';
    3425                        if ( is_single() ) {
    35                                 the_title( '<h1 class="entry-title">', '</h1>' );
    36                         } elseif ( is_front_page() && is_home() ) {
    37                                 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     26                                twentyseventeen_posted_on();
    3827                        } else {
    39                                 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    40                         }
     28                                echo twentyseventeen_time_link();
     29                                twentyseventeen_edit_link();
     30                        };
     31                        echo '</div><!-- .entry-meta -->';
     32                };
     33
     34                if ( is_single() ) {
     35                        the_title( '<h1 class="entry-title">', '</h1>' );
     36                } elseif ( is_front_page() && is_home() ) {
     37                        the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     38                } else {
     39                        the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
     40                }
    4141                ?>
    4242        </header><!-- .entry-header -->
    4343
     
    6767                                'link_after'  => '</span>',
    6868                        ) );
    6969
    70                 };
     70};
    7171                ?>
    7272
    7373        </div><!-- .entry-content -->
  • src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php

     
    1414
    1515<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1616        <?php
    17                 if ( is_sticky() && is_home() ) {
    18                         echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
    19                 }
     17        if ( is_sticky() && is_home() ) {
     18                echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
     19        }
    2020        ?>
    2121        <header class="entry-header">
    2222                <?php
    23                         if ( 'post' === get_post_type() ) {
    24                                 echo '<div class="entry-meta">';
    25                                         if ( is_single() ) {
    26                                                 twentyseventeen_posted_on();
    27                                         } else {
    28                                                 echo twentyseventeen_time_link();
    29                                                 twentyseventeen_edit_link();
    30                                         }
    31                                 echo '</div><!-- .entry-meta -->';
    32                         };
    33 
     23                if ( 'post' === get_post_type() ) {
     24                        echo '<div class="entry-meta">';
    3425                        if ( is_single() ) {
    35                                 the_title( '<h1 class="entry-title">', '</h1>' );
    36                         } elseif ( is_front_page() && is_home() ) {
    37                                 the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     26                                twentyseventeen_posted_on();
    3827                        } else {
    39                                 the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
     28                                echo twentyseventeen_time_link();
     29                                twentyseventeen_edit_link();
    4030                        }
     31                        echo '</div><!-- .entry-meta -->';
     32                };
     33
     34                if ( is_single() ) {
     35                        the_title( '<h1 class="entry-title">', '</h1>' );
     36                } elseif ( is_front_page() && is_home() ) {
     37                        the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
     38                } else {
     39                        the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
     40                }
    4141                ?>
    4242        </header><!-- .entry-header -->
    4343
     
    4646                $video = false;
    4747
    4848                // Only get video from the content if a playlist isn't present.
    49                 if ( false === strpos( $content, 'wp-playlist-script' ) ) {
    50                         $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
    51                 }
     49        if ( false === strpos( $content, 'wp-playlist-script' ) ) {
     50                $video = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
     51        }
    5252        ?>
    5353
    5454        <?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty( $video ) ) : ?>
  • src/wp-content/themes/twentyseventeen/template-parts/post/content.php

     
    2222                <?php
    2323                if ( 'post' === get_post_type() ) {
    2424                        echo '<div class="entry-meta">';
    25                                 if ( is_single() ) {
    26                                         twentyseventeen_posted_on();
    27                                 } else {
    28                                         echo twentyseventeen_time_link();
    29                                         twentyseventeen_edit_link();
    30                                 };
     25                        if ( is_single() ) {
     26                                twentyseventeen_posted_on();
     27                        } else {
     28                                echo twentyseventeen_time_link();
     29                                twentyseventeen_edit_link();
     30                        };
    3131                        echo '</div><!-- .entry-meta -->';
    3232                };
    3333
  • src/wp-content/themes/twentysixteen/archive.php

     
    4141                                 */
    4242                                get_template_part( 'template-parts/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', 'twentysixteen' ) . ' </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( 'template-parts/content', 'none' );
    5757
  • src/wp-content/themes/twentysixteen/comments.php

     
    2626                <h2 class="comments-title">
    2727                        <?php
    2828                                $comments_number = get_comments_number();
    29                                 if ( 1 === $comments_number ) {
    30                                         /* translators: %s: post title */
    31                                         printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentysixteen' ), get_the_title() );
    32                                 } else {
    33                                         printf(
    34                                                 /* translators: 1: number of comments, 2: post title */
    35                                                 _nx(
    36                                                         '%1$s thought on &ldquo;%2$s&rdquo;',
    37                                                         '%1$s thoughts on &ldquo;%2$s&rdquo;',
    38                                                         $comments_number,
    39                                                         'comments title',
    40                                                         'twentysixteen'
    41                                                 ),
    42                                                 number_format_i18n( $comments_number ),
    43                                                 get_the_title()
    44                                         );
    45                                 }
     29                        if ( 1 === $comments_number ) {
     30                                /* translators: %s: post title */
     31                                printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentysixteen' ), get_the_title() );
     32                        } else {
     33                                printf(
     34                                        /* translators: 1: number of comments, 2: post title */
     35                                        _nx(
     36                                                '%1$s thought on &ldquo;%2$s&rdquo;',
     37                                                '%1$s thoughts on &ldquo;%2$s&rdquo;',
     38                                                $comments_number,
     39                                                'comments title',
     40                                                'twentysixteen'
     41                                        ),
     42                                        number_format_i18n( $comments_number ),
     43                                        get_the_title()
     44                                );
     45                        }
    4646                        ?>
    4747                </h2>
    4848
     
    6464
    6565        <?php
    6666                // If comments are closed and there are comments, let's leave a little note, shall we?
    67                 if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
     67        if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    6868        ?>
    69                 <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
     69        <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
    7070        <?php endif; ?>
    7171
    7272        <?php
  • src/wp-content/themes/twentysixteen/footer.php

     
    1919                                                wp_nav_menu( array(
    2020                                                        'theme_location' => 'primary',
    2121                                                        'menu_class'     => 'primary-menu',
    22                                                  ) );
     22                                                ) );
    2323                                        ?>
    2424                                </nav><!-- .main-navigation -->
    2525                        <?php endif; ?>
  • src/wp-content/themes/twentysixteen/functions.php

     
    3333}
    3434
    3535if ( ! function_exists( 'twentysixteen_setup' ) ) :
    36 /**
     36        /**
    3737 * Sets up theme defaults and registers support for various WordPress features.
    3838 *
    3939 * Note that this function is hooked into the after_setup_theme hook, which
     
    4444 *
    4545 * @since Twenty Sixteen 1.0
    4646 */
    47 function twentysixteen_setup() {
    48         /*
    49          * Make theme available for translation.
    50          * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen
    51          * If you're building a theme based on Twenty Sixteen, use a find and replace
    52          * to change 'twentysixteen' to the name of your theme in all the template files
    53          */
    54         load_theme_textdomain( 'twentysixteen' );
    55 
    56         // Add default posts and comments RSS feed links to head.
    57         add_theme_support( 'automatic-feed-links' );
    58 
    59         /*
    60          * Let WordPress manage the document title.
    61          * By adding theme support, we declare that this theme does not use a
    62          * hard-coded <title> tag in the document head, and expect WordPress to
    63          * provide it for us.
    64          */
    65         add_theme_support( 'title-tag' );
    66 
    67         /*
    68          * Enable support for custom logo.
    69          *
    70          *  @since Twenty Sixteen 1.2
    71          */
    72         add_theme_support( 'custom-logo', array(
    73                 'height'      => 240,
    74                 'width'       => 240,
    75                 'flex-height' => true,
    76         ) );
    77 
    78         /*
    79          * Enable support for Post Thumbnails on posts and pages.
    80          *
    81          * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    82          */
    83         add_theme_support( 'post-thumbnails' );
    84         set_post_thumbnail_size( 1200, 9999 );
    85 
    86         // This theme uses wp_nav_menu() in two locations.
    87         register_nav_menus( array(
    88                 'primary' => __( 'Primary Menu', 'twentysixteen' ),
    89                 'social'  => __( 'Social Links Menu', 'twentysixteen' ),
    90         ) );
    91 
    92         /*
    93          * Switch default core markup for search form, comment form, and comments
    94          * to output valid HTML5.
    95          */
    96         add_theme_support( 'html5', array(
    97                 'search-form',
    98                 'comment-form',
    99                 'comment-list',
    100                 'gallery',
    101                 'caption',
    102         ) );
    103 
    104         /*
    105          * Enable support for Post Formats.
    106          *
    107          * See: https://codex.wordpress.org/Post_Formats
    108          */
    109         add_theme_support( 'post-formats', array(
    110                 'aside',
    111                 'image',
    112                 'video',
    113                 'quote',
    114                 'link',
    115                 'gallery',
    116                 'status',
    117                 'audio',
    118                 'chat',
    119         ) );
     47        function twentysixteen_setup() {
     48                /*
     49                 * Make theme available for translation.
     50                 * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen
     51                 * If you're building a theme based on Twenty Sixteen, use a find and replace
     52                 * to change 'twentysixteen' to the name of your theme in all the template files
     53                 */
     54                load_theme_textdomain( 'twentysixteen' );
     55
     56                // Add default posts and comments RSS feed links to head.
     57                add_theme_support( 'automatic-feed-links' );
     58
     59                /*
     60                 * Let WordPress manage the document title.
     61                 * By adding theme support, we declare that this theme does not use a
     62                 * hard-coded <title> tag in the document head, and expect WordPress to
     63                 * provide it for us.
     64                 */
     65                add_theme_support( 'title-tag' );
     66
     67                /*
     68                 * Enable support for custom logo.
     69                 *
     70                 *  @since Twenty Sixteen 1.2
     71                 */
     72                add_theme_support( 'custom-logo', array(
     73                        'height'      => 240,
     74                        'width'       => 240,
     75                        'flex-height' => true,
     76                ) );
     77
     78                        /*
     79                         * Enable support for Post Thumbnails on posts and pages.
     80                         *
     81                         * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
     82                         */
     83                        add_theme_support( 'post-thumbnails' );
     84                        set_post_thumbnail_size( 1200, 9999 );
     85
     86                        // This theme uses wp_nav_menu() in two locations.
     87                        register_nav_menus( array(
     88                                'primary' => __( 'Primary Menu', 'twentysixteen' ),
     89                                'social'  => __( 'Social Links Menu', 'twentysixteen' ),
     90                        ) );
     91
     92                        /*
     93                         * Switch default core markup for search form, comment form, and comments
     94                         * to output valid HTML5.
     95                         */
     96                        add_theme_support( 'html5', array(
     97                                'search-form',
     98                                'comment-form',
     99                                'comment-list',
     100                                'gallery',
     101                                'caption',
     102                        ) );
     103
     104                        /*
     105                         * Enable support for Post Formats.
     106                         *
     107                         * See: https://codex.wordpress.org/Post_Formats
     108                         */
     109                        add_theme_support( 'post-formats', array(
     110                                'aside',
     111                                'image',
     112                                'video',
     113                                'quote',
     114                                'link',
     115                                'gallery',
     116                                'status',
     117                                'audio',
     118                                'chat',
     119                        ) );
     120
     121                        /*
     122                         * This theme styles the visual editor to resemble the theme style,
     123                         * specifically font, colors, icons, and column width.
     124                         */
     125                        add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) );
    120126
    121         /*
    122          * This theme styles the visual editor to resemble the theme style,
    123          * specifically font, colors, icons, and column width.
    124          */
    125         add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) );
    126 
    127         // Indicate widget sidebars can use selective refresh in the Customizer.
    128         add_theme_support( 'customize-selective-refresh-widgets' );
    129 }
     127                        // Indicate widget sidebars can use selective refresh in the Customizer.
     128                        add_theme_support( 'customize-selective-refresh-widgets' );
     129        }
    130130endif; // twentysixteen_setup
    131131add_action( 'after_setup_theme', 'twentysixteen_setup' );
    132132
     
    185185add_action( 'widgets_init', 'twentysixteen_widgets_init' );
    186186
    187187if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
    188 /**
     188        /**
    189189 * Register Google fonts for Twenty Sixteen.
    190190 *
    191191 * Create your own twentysixteen_fonts_url() function to override in a child theme.
     
    194194 *
    195195 * @return string Google fonts URL for the theme.
    196196 */
    197 function twentysixteen_fonts_url() {
    198         $fonts_url = '';
    199         $fonts     = array();
    200         $subsets   = 'latin,latin-ext';
    201 
    202         /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
    203         if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
    204                 $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic';
    205         }
    206 
    207         /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */
    208         if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
    209                 $fonts[] = 'Montserrat:400,700';
    210         }
    211 
    212         /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */
    213         if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) {
    214                 $fonts[] = 'Inconsolata:400';
    215         }
     197        function twentysixteen_fonts_url() {
     198                $fonts_url = '';
     199                $fonts     = array();
     200                $subsets   = 'latin,latin-ext';
     201
     202                /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */
     203                if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) {
     204                        $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic';
     205                }
     206
     207                /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */
     208                if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) {
     209                        $fonts[] = 'Montserrat:400,700';
     210                }
     211
     212                /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */
     213                if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) {
     214                        $fonts[] = 'Inconsolata:400';
     215                }
     216
     217                if ( $fonts ) {
     218                        $fonts_url = add_query_arg( array(
     219                                'family' => urlencode( implode( '|', $fonts ) ),
     220                                'subset' => urlencode( $subsets ),
     221                        ), 'https://fonts.googleapis.com/css' );
     222                }
    216223
    217         if ( $fonts ) {
    218                 $fonts_url = add_query_arg( array(
    219                         'family' => urlencode( implode( '|', $fonts ) ),
    220                         'subset' => urlencode( $subsets ),
    221                 ), 'https://fonts.googleapis.com/css' );
     224                return $fonts_url;
    222225        }
    223 
    224         return $fonts_url;
    225 }
    226226endif;
    227227
    228228/**
     
    333333        $color = trim( $color, '#' );
    334334
    335335        if ( strlen( $color ) === 3 ) {
    336                 $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) );
    337                 $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) );
    338                 $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) );
    339         } else if ( strlen( $color ) === 6 ) {
     336                $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
     337                $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
     338                $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
     339        } elseif ( strlen( $color ) === 6 ) {
    340340                $r = hexdec( substr( $color, 0, 2 ) );
    341341                $g = hexdec( substr( $color, 2, 2 ) );
    342342                $b = hexdec( substr( $color, 4, 2 ) );
     
    344344                return array();
    345345        }
    346346
    347         return array( 'red' => $r, 'green' => $g, 'blue' => $b );
     347        return array(
     348                'red' => $r,
     349                'green' => $g,
     350                'blue' => $b,
     351        );
    348352}
    349353
    350354/**
  • src/wp-content/themes/twentysixteen/header.php

     
    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                                </div><!-- .site-branding -->
     
    5353                                                                        wp_nav_menu( array(
    5454                                                                                'theme_location' => 'primary',
    5555                                                                                'menu_class'     => 'primary-menu',
    56                                                                          ) );
     56                                                                        ) );
    5757                                                                ?>
    5858                                                        </nav><!-- .main-navigation -->
    5959                                                <?php endif; ?>
  • src/wp-content/themes/twentysixteen/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', 'twentysixteen' ) ); ?></div>
    25                                                         <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></div>
    26                                                 </div><!-- .nav-links -->
    27                                         </nav><!-- .image-navigation -->
    28 
    29                                         <header class="entry-header">
    30                                                 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    31                                         </header><!-- .entry-header -->
    32 
    33                                         <div class="entry-content">
    34 
    35                                                 <div class="entry-attachment">
    36                                                         <?php
    37                                                                 /**
     22                        <nav id="image-navigation" class="navigation image-navigation">
     23                                <div class="nav-links">
     24                                        <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentysixteen' ) ); ?></div>
     25                                        <div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentysixteen' ) ); ?></div>
     26                                </div><!-- .nav-links -->
     27                        </nav><!-- .image-navigation -->
     28
     29                        <header class="entry-header">
     30                                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
     31                        </header><!-- .entry-header -->
     32
     33                        <div class="entry-content">
     34
     35                                <div class="entry-attachment">
     36                                        <?php
     37                                                /**
    3838                                                                 * Filter the default twentysixteen image attachment size.
    3939                                                                 *
    4040                                                                 * @since Twenty Sixteen 1.0
    4141                                                                 *
    4242                                                                 * @param string $image_size Image size. Default 'large'.
    4343                                                                 */
    44                                                                 $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' );
     44                                                $image_size = apply_filters( 'twentysixteen_attachment_size', 'large' );
    4545
    46                                                                 echo wp_get_attachment_image( get_the_ID(), $image_size );
    47                                                         ?>
     46                                                echo wp_get_attachment_image( get_the_ID(), $image_size );
     47                                        ?>
    4848
    49                                                         <?php twentysixteen_excerpt( 'entry-caption' ); ?>
     49                                        <?php twentysixteen_excerpt( 'entry-caption' ); ?>
    5050
    5151                                                </div><!-- .entry-attachment -->
    5252
    5353                                                <?php
    54                                                         the_content();
    55                                                         wp_link_pages( array(
    56                                                                 'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>',
    57                                                                 'after'       => '</div>',
    58                                                                 'link_before' => '<span>',
    59                                                                 'link_after'  => '</span>',
    60                                                                 'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%',
    61                                                                 'separator'   => '<span class="screen-reader-text">, </span>',
    62                                                         ) );
    63                                                 ?>
     54                                                the_content();
     55                                                wp_link_pages( array(
     56                                                        'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentysixteen' ) . '</span>',
     57                                                        'after'       => '</div>',
     58                                                        'link_before' => '<span>',
     59                                                        'link_after'  => '</span>',
     60                                                        'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>%',
     61                                                        'separator'   => '<span class="screen-reader-text">, </span>',
     62                                                ) );
     63                                        ?>
    6464                                        </div><!-- .entry-content -->
    6565
    6666                                        <footer class="entry-footer">
    67                                                 <?php twentysixteen_entry_meta(); ?>
    68                                                 <?php
    69                                                         // Retrieve attachment metadata.
    70                                                         $metadata = wp_get_attachment_metadata();
    71                                                         if ( $metadata ) {
    72                                                                 printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>',
    73                                                                         esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ),
    74                                                                         esc_url( wp_get_attachment_url() ),
    75                                                                         absint( $metadata['width'] ),
    76                                                                         absint( $metadata['height'] )
    77                                                                 );
    78                                                         }
    79                                                 ?>
    80                                                 <?php
    81                                                         edit_post_link(
    82                                                                 sprintf(
    83                                                                         /* translators: %s: Name of current post */
    84                                                                         __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
    85                                                                         get_the_title()
    86                                                                 ),
    87                                                                 '<span class="edit-link">',
    88                                                                 '</span>'
    89                                                         );
    90                                                 ?>
     67                                        <?php twentysixteen_entry_meta(); ?>
     68                                        <?php
     69                                        // Retrieve attachment metadata.
     70                                        $metadata = wp_get_attachment_metadata();
     71                                        if ( $metadata ) {
     72                                                printf( '<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>',
     73                                                        esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ),
     74                                                        esc_url( wp_get_attachment_url() ),
     75                                                        absint( $metadata['width'] ),
     76                                                        absint( $metadata['height'] )
     77                                                );
     78                                        }
     79                                        ?>
     80                                        <?php
     81                                        edit_post_link(
     82                                                sprintf(
     83                                                        /* translators: %s: Name of current post */
     84                                                        __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
     85                                                        get_the_title()
     86                                                ),
     87                                                '<span class="edit-link">',
     88                                                '</span>'
     89                                        );
     90                                        ?>
    9191                                        </footer><!-- .entry-footer -->
    9292                                </article><!-- #post-## -->
    9393
    9494                                <?php
    95                                         // If comments are open or we have at least one comment, load up the comment template.
    96                                         if ( comments_open() || get_comments_number() ) {
    97                                                 comments_template();
    98                                         }
    99 
    100                                         // Parent post navigation.
    101                                         the_post_navigation( array(
    102                                                 'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ),
    103                                         ) );
     95                                // If comments are open or we have at least one comment, load up the comment template.
     96                                if ( comments_open() || get_comments_number() ) {
     97                                        comments_template();
     98                                }
     99
     100                                // Parent post navigation.
     101                                the_post_navigation( array(
     102                                        'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ),
     103                                ) );
    104104                                // End the loop.
    105105                                endwhile;
    106106                        ?>
  • src/wp-content/themes/twentysixteen/inc/customizer.php

     
    6161add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' );
    6262
    6363if ( ! function_exists( 'twentysixteen_header_style' ) ) :
    64 /**
     64        /**
    6565 * Styles the header text displayed on the site.
    6666 *
    6767 * Create your own twentysixteen_header_style() function to override in a child theme.
     
    7070 *
    7171 * @see twentysixteen_custom_header_and_background().
    7272 */
    73 function twentysixteen_header_style() {
    74         // If the header text option is untouched, let's bail.
    75         if ( display_header_text() ) {
    76                 return;
    77         }
     73        function twentysixteen_header_style() {
     74                // If the header text option is untouched, let's bail.
     75                if ( display_header_text() ) {
     76                        return;
     77                }
    7878
    79         // If the header text has been hidden.
    80         ?>
    81         <style type="text/css" id="twentysixteen-header-css">
     79                // If the header text has been hidden.
     80                ?>
     81                <style type="text/css" id="twentysixteen-header-css">
    8282                .site-branding {
    8383                        margin: 0 auto 0 0;
    8484                }
     
    8888                        clip: rect(1px, 1px, 1px, 1px);
    8989                        position: absolute;
    9090                }
    91         </style>
    92         <?php
    93 }
     91                </style>
     92                <?php
     93        }
    9494endif; // twentysixteen_header_style
    9595
    9696/**
     
    303303}
    304304
    305305if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) :
    306 /**
     306        /**
    307307 * Retrieves the current Twenty Sixteen color scheme.
    308308 *
    309309 * Create your own twentysixteen_get_color_scheme() function to override in a child theme.
     
    312312 *
    313313 * @return array An associative array of either the current or default color scheme HEX values.
    314314 */
    315 function twentysixteen_get_color_scheme() {
    316         $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
    317         $color_schemes       = twentysixteen_get_color_schemes();
     315        function twentysixteen_get_color_scheme() {
     316                $color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
     317                $color_schemes       = twentysixteen_get_color_schemes();
    318318
    319         if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
    320                 return $color_schemes[ $color_scheme_option ]['colors'];
    321         }
     319                if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
     320                        return $color_schemes[ $color_scheme_option ]['colors'];
     321                }
    322322
    323         return $color_schemes['default']['colors'];
    324 }
     323                return $color_schemes['default']['colors'];
     324        }
    325325endif; // twentysixteen_get_color_scheme
    326326
    327327if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) :
    328 /**
     328        /**
    329329 * Retrieves an array of color scheme choices registered for Twenty Sixteen.
    330330 *
    331331 * Create your own twentysixteen_get_color_scheme_choices() function to override
     
    335335 *
    336336 * @return array Array of color schemes.
    337337 */
    338 function twentysixteen_get_color_scheme_choices() {
    339         $color_schemes                = twentysixteen_get_color_schemes();
    340         $color_scheme_control_options = array();
     338        function twentysixteen_get_color_scheme_choices() {
     339                $color_schemes                = twentysixteen_get_color_schemes();
     340                $color_scheme_control_options = array();
    341341
    342         foreach ( $color_schemes as $color_scheme => $value ) {
    343                 $color_scheme_control_options[ $color_scheme ] = $value['label'];
    344         }
     342                foreach ( $color_schemes as $color_scheme => $value ) {
     343                        $color_scheme_control_options[ $color_scheme ] = $value['label'];
     344                }
    345345
    346         return $color_scheme_control_options;
    347 }
     346                return $color_scheme_control_options;
     347        }
    348348endif; // twentysixteen_get_color_scheme_choices
    349349
    350350
    351351if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) :
    352 /**
     352        /**
    353353 * Handles sanitization for Twenty Sixteen color schemes.
    354354 *
    355355 * Create your own twentysixteen_sanitize_color_scheme() function to override
     
    360360 * @param string $value Color scheme name value.
    361361 * @return string Color scheme name.
    362362 */
    363 function twentysixteen_sanitize_color_scheme( $value ) {
    364         $color_schemes = twentysixteen_get_color_scheme_choices();
     363        function twentysixteen_sanitize_color_scheme( $value ) {
     364                $color_schemes = twentysixteen_get_color_scheme_choices();
    365365
    366         if ( ! array_key_exists( $value, $color_schemes ) ) {
    367                 return 'default';
    368         }
     366                if ( ! array_key_exists( $value, $color_schemes ) ) {
     367                        return 'default';
     368                }
    369369
    370         return $value;
    371 }
     370                return $value;
     371        }
    372372endif; // twentysixteen_sanitize_color_scheme
    373373
    374374/**
  • src/wp-content/themes/twentysixteen/inc/template-tags.php

     
    1010 */
    1111
    1212if ( ! function_exists( 'twentysixteen_entry_meta' ) ) :
    13 /**
     13        /**
    1414 * Prints HTML with meta information for the categories, tags.
    1515 *
    1616 * Create your own twentysixteen_entry_meta() function to override in a child theme.
    1717 *
    1818 * @since Twenty Sixteen 1.0
    1919 */
    20 function twentysixteen_entry_meta() {
    21         if ( 'post' === get_post_type() ) {
    22                 $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
    23                 printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>',
    24                         get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
    25                         _x( 'Author', 'Used before post author name.', 'twentysixteen' ),
    26                         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    27                         get_the_author()
    28                 );
    29         }
    30 
    31         if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
    32                 twentysixteen_entry_date();
    33         }
    34 
    35         $format = get_post_format();
    36         if ( current_theme_supports( 'post-formats', $format ) ) {
    37                 printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
    38                         sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
    39                         esc_url( get_post_format_link( $format ) ),
    40                         get_post_format_string( $format )
    41                 );
    42         }
    43 
    44         if ( 'post' === get_post_type() ) {
    45                 twentysixteen_entry_taxonomies();
    46         }
    47 
    48         if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    49                 echo '<span class="comments-link">';
    50                 comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) );
    51                 echo '</span>';
     20        function twentysixteen_entry_meta() {
     21                if ( 'post' === get_post_type() ) {
     22                        $author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 );
     23                        printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>',
     24                                get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ),
     25                                _x( 'Author', 'Used before post author name.', 'twentysixteen' ),
     26                                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     27                                get_the_author()
     28                        );
     29                }
     30
     31                if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
     32                        twentysixteen_entry_date();
     33                }
     34
     35                $format = get_post_format();
     36                if ( current_theme_supports( 'post-formats', $format ) ) {
     37                        printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
     38                                sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ),
     39                                esc_url( get_post_format_link( $format ) ),
     40                                get_post_format_string( $format )
     41                        );
     42                }
     43
     44                if ( 'post' === get_post_type() ) {
     45                        twentysixteen_entry_taxonomies();
     46                }
     47
     48                if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
     49                        echo '<span class="comments-link">';
     50                        comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen' ), get_the_title() ) );
     51                        echo '</span>';
     52                }
    5253        }
    53 }
    5454endif;
    5555
    5656if ( ! function_exists( 'twentysixteen_entry_date' ) ) :
    57 /**
     57        /**
    5858 * Prints HTML with date information for current post.
    5959 *
    6060 * Create your own twentysixteen_entry_date() function to override in a child theme.
    6161 *
    6262 * @since Twenty Sixteen 1.0
    6363 */
    64 function twentysixteen_entry_date() {
    65         $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     64        function twentysixteen_entry_date() {
     65                $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    6666
    67         if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    68                 $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    69         }
     67                if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
     68                        $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     69                }
     70
     71                $time_string = sprintf( $time_string,
     72                        esc_attr( get_the_date( 'c' ) ),
     73                        get_the_date(),
     74                        esc_attr( get_the_modified_date( 'c' ) ),
     75                        get_the_modified_date()
     76                );
    7077
    71         $time_string = sprintf( $time_string,
    72                 esc_attr( get_the_date( 'c' ) ),
    73                 get_the_date(),
    74                 esc_attr( get_the_modified_date( 'c' ) ),
    75                 get_the_modified_date()
    76         );
    77 
    78         printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
    79                 _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ),
    80                 esc_url( get_permalink() ),
    81                 $time_string
    82         );
    83 }
     78                        printf( '<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
     79                                _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ),
     80                                esc_url( get_permalink() ),
     81                                $time_string
     82                        );
     83        }
    8484endif;
    8585
    8686if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) :
    87 /**
     87        /**
    8888 * Prints HTML with category and tags for current post.
    8989 *
    9090 * Create your own twentysixteen_entry_taxonomies() function to override in a child theme.
    9191 *
    9292 * @since Twenty Sixteen 1.0
    9393 */
    94 function twentysixteen_entry_taxonomies() {
    95         $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
    96         if ( $categories_list && twentysixteen_categorized_blog() ) {
    97                 printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    98                         _x( 'Categories', 'Used before category names.', 'twentysixteen' ),
    99                         $categories_list
    100                 );
     94        function twentysixteen_entry_taxonomies() {
     95                $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
     96                if ( $categories_list && twentysixteen_categorized_blog() ) {
     97                        printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     98                                _x( 'Categories', 'Used before category names.', 'twentysixteen' ),
     99                                $categories_list
     100                        );
     101                }
     102
     103                $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
     104                if ( $tags_list ) {
     105                        printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
     106                                _x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
     107                                $tags_list
     108                        );
     109                }
    101110        }
    102 
    103         $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) );
    104         if ( $tags_list ) {
    105                 printf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
    106                         _x( 'Tags', 'Used before tag names.', 'twentysixteen' ),
    107                         $tags_list
    108                 );
    109         }
    110 }
    111111endif;
    112112
    113113if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) :
    114 /**
     114        /**
    115115 * Displays an optional post thumbnail.
    116116 *
    117117 * Wraps the post thumbnail in an anchor element on index views, or a div
     
    121121 *
    122122 * @since Twenty Sixteen 1.0
    123123 */
    124 function twentysixteen_post_thumbnail() {
    125         if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
    126                 return;
    127         }
     124        function twentysixteen_post_thumbnail() {
     125                if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
     126                        return;
     127                }
    128128
    129         if ( is_singular() ) :
    130         ?>
     129                if ( is_singular() ) :
     130                ?>
    131131
    132         <div class="post-thumbnail">
     132                <div class="post-thumbnail">
    133133                <?php the_post_thumbnail(); ?>
    134134        </div><!-- .post-thumbnail -->
    135135
    136136        <?php else : ?>
    137137
    138138        <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
    139                 <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
     139                <?php the_post_thumbnail( 'post-thumbnail', array(
     140                        'alt' => the_title_attribute( 'echo=0' ),
     141                ) ); ?>
    140142        </a>
    141143
    142144        <?php endif; // End is_singular()
    143 }
     145        }
    144146endif;
    145147
    146148if ( ! function_exists( 'twentysixteen_excerpt' ) ) :
     
    167169endif;
    168170
    169171if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) :
    170 /**
     172        /**
    171173 * Replaces "[...]" (appended to automatically generated excerpts) with ... and
    172174 * a 'Continue reading' link.
    173175 *
     
    177179 *
    178180 * @return string 'Continue reading' link prepended with an ellipsis.
    179181 */
    180 function twentysixteen_excerpt_more() {
    181         $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
    182                 esc_url( get_permalink( get_the_ID() ) ),
    183                 /* translators: %s: Name of current post */
    184                 sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
    185         );
    186         return ' &hellip; ' . $link;
    187 }
    188 add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' );
     182        function twentysixteen_excerpt_more() {
     183                $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
     184                        esc_url( get_permalink( get_the_ID() ) ),
     185                        /* translators: %s: Name of current post */
     186                        sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ), get_the_title( get_the_ID() ) )
     187                );
     188                        return ' &hellip; ' . $link;
     189        }
     190        add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' );
    189191endif;
    190192
    191193if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) :
    192 /**
     194        /**
    193195 * Determines whether blog/site has more than one category.
    194196 *
    195197 * Create your own twentysixteen_categorized_blog() function to override in a child theme.
     
    198200 *
    199201 * @return bool True if there is more than one category, false otherwise.
    200202 */
    201 function twentysixteen_categorized_blog() {
    202         if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) {
    203                 // Create an array of all the categories that are attached to posts.
    204                 $all_the_cool_cats = get_categories( array(
    205                         'fields'     => 'ids',
    206                         // We only need to know if there is more than one category.
    207                         'number'     => 2,
    208                 ) );
    209 
    210                 // Count the number of categories that are attached to the posts.
    211                 $all_the_cool_cats = count( $all_the_cool_cats );
    212 
    213                 set_transient( 'twentysixteen_categories', $all_the_cool_cats );
    214         }
    215 
    216         if ( $all_the_cool_cats > 1 ) {
    217                 // This blog has more than 1 category so twentysixteen_categorized_blog should return true.
    218                 return true;
    219         } else {
    220                 // This blog has only 1 category so twentysixteen_categorized_blog should return false.
    221                 return false;
     203        function twentysixteen_categorized_blog() {
     204                if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) {
     205                        // Create an array of all the categories that are attached to posts.
     206                        $all_the_cool_cats = get_categories( array(
     207                                'fields'     => 'ids',
     208                                // We only need to know if there is more than one category.
     209                                'number'     => 2,
     210                        ) );
     211
     212                        // Count the number of categories that are attached to the posts.
     213                        $all_the_cool_cats = count( $all_the_cool_cats );
     214
     215                        set_transient( 'twentysixteen_categories', $all_the_cool_cats );
     216                }
     217
     218                if ( $all_the_cool_cats > 1 ) {
     219                        // This blog has more than 1 category so twentysixteen_categorized_blog should return true.
     220                        return true;
     221                } else {
     222                        // This blog has only 1 category so twentysixteen_categorized_blog should return false.
     223                        return false;
     224                }
    222225        }
    223 }
    224226endif;
    225227
    226228/**
     
    239241add_action( 'save_post',     'twentysixteen_category_transient_flusher' );
    240242
    241243if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) :
    242 /**
     244        /**
    243245 * Displays the optional custom logo.
    244246 *
    245247 * Does nothing if the custom logo is not available.
    246248 *
    247249 * @since Twenty Sixteen 1.2
    248250 */
    249 function twentysixteen_the_custom_logo() {
    250         if ( function_exists( 'the_custom_logo' ) ) {
    251                 the_custom_logo();
     251        function twentysixteen_the_custom_logo() {
     252                if ( function_exists( 'the_custom_logo' ) ) {
     253                        the_custom_logo();
     254                }
    252255        }
    253 }
    254256endif;
  • src/wp-content/themes/twentysixteen/index.php

     
    3838                                 */
    3939                                get_template_part( 'template-parts/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', 'twentysixteen' ) . ' </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( 'template-parts/content', 'none' );
    5454
  • src/wp-content/themes/twentysixteen/search.php

     
    2929                                 */
    3030                                get_template_part( 'template-parts/content', 'search' );
    3131
    32                         // End the loop.
     32                                // End the loop.
    3333                        endwhile;
    3434
    3535                        // Previous/next page navigation.
     
    3939                                'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
    4040                        ) );
    4141
    42                 // If no content, include the "No posts found" template.
     42                        // If no content, include the "No posts found" template.
    4343                else :
    4444                        get_template_part( 'template-parts/content', 'none' );
    4545
  • src/wp-content/themes/twentysixteen/sidebar.php

     
    88 */
    99?>
    1010
    11 <?php if ( is_active_sidebar( 'sidebar-1' )  ) : ?>
     11<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    1212        <aside id="secondary" class="sidebar widget-area" role="complementary">
    1313                <?php dynamic_sidebar( 'sidebar-1' ); ?>
    1414        </aside><!-- .sidebar .widget-area -->
  • src/wp-content/themes/twentyten/404.php

     
    2727                document.getElementById('s') && document.getElementById('s').focus();
    2828        </script>
    2929
    30 <?php get_footer(); ?>
    31  No newline at end of file
     30<?php get_footer(); ?>
  • src/wp-content/themes/twentyten/archive.php

     
    2525         * We reset this later so we can run the loop
    2626         * properly with a call to rewind_posts().
    2727         */
    28         if ( have_posts() )
    29                 the_post();
     28if ( have_posts() ) {
     29        the_post();
     30}
    3031?>
    3132
    3233                        <h1 class="page-title">
  • src/wp-content/themes/twentyten/author.php

     
    2121         * We reset this later so we can run the loop
    2222         * properly with a call to rewind_posts().
    2323         */
    24         if ( have_posts() )
    25                 the_post();
     24if ( have_posts() ) {
     25        the_post();
     26}
    2627?>
    2728
    2829                                <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
  • src/wp-content/themes/twentyten/category.php

     
    1717                                ?></h1>
    1818                                <?php
    1919                                        $category_description = category_description();
    20                                         if ( ! empty( $category_description ) )
    21                                                 echo '<div class="archive-meta">' . $category_description . '</div>';
     20                                if ( ! empty( $category_description ) ) {
     21                                        echo '<div class="archive-meta">' . $category_description . '</div>';
     22                                }
    2223
    2324                                /*
    2425                                 * Run the loop for the category page to output the posts.
  • src/wp-content/themes/twentyten/functions.php

     
    4444 * Used to set the width of images and content. Should be equal to the width the theme
    4545 * is designed for, generally via the style.css stylesheet.
    4646 */
    47 if ( ! isset( $content_width ) )
     47if ( ! isset( $content_width ) ) {
    4848        $content_width = 640;
     49}
    4950
    5051/* Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */
    5152add_action( 'after_setup_theme', 'twentyten_setup' );
    5253
    53 if ( ! function_exists( 'twentyten_setup' ) ):
    54 /**
     54if ( ! function_exists( 'twentyten_setup' ) ) :
     55        /**
    5556 * Set up theme defaults and registers support for various WordPress features.
    5657 *
    5758 * Note that this function is hooked into the after_setup_theme hook, which runs
     
    7071 *
    7172 * @since Twenty Ten 1.0
    7273 */
    73 function twentyten_setup() {
    74 
    75         // This theme styles the visual editor with editor-style.css to match the theme style.
    76         add_editor_style();
     74        function twentyten_setup() {
    7775
    78         // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
    79         add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
     76                // This theme styles the visual editor with editor-style.css to match the theme style.
     77                add_editor_style();
    8078
    81         // This theme uses post thumbnails
    82         add_theme_support( 'post-thumbnails' );
     79                // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
     80                add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
    8381
    84         // Add default posts and comments RSS feed links to head
    85         add_theme_support( 'automatic-feed-links' );
     82                // This theme uses post thumbnails
     83                add_theme_support( 'post-thumbnails' );
    8684
    87         /*
    88          * Make theme available for translation.
    89          * Translations can be filed in the /languages/ directory
    90          */
    91         load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
    92 
    93         // This theme uses wp_nav_menu() in one location.
    94         register_nav_menus( array(
    95                 'primary' => __( 'Primary Navigation', 'twentyten' ),
    96         ) );
     85                // Add default posts and comments RSS feed links to head
     86                add_theme_support( 'automatic-feed-links' );
    9787
    98         // This theme allows users to set a custom background.
    99         add_theme_support( 'custom-background', array(
    100                 // Let WordPress know what our default background color is.
    101                 'default-color' => 'f1f1f1',
    102         ) );
    103 
    104         // The custom header business starts here.
    105 
    106         $custom_header_support = array(
    10788                /*
    108                  * The default image to use.
    109                  * The %s is a placeholder for the theme template directory URI.
     89                 * Make theme available for translation.
     90                 * Translations can be filed in the /languages/ directory
    11091                 */
    111                 'default-image' => '%s/images/headers/path.jpg',
    112                 // The height and width of our custom header.
    113                 /**
     92                load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
     93
     94                // This theme uses wp_nav_menu() in one location.
     95                register_nav_menus( array(
     96                        'primary' => __( 'Primary Navigation', 'twentyten' ),
     97                ) );
     98
     99                        // This theme allows users to set a custom background.
     100                        add_theme_support( 'custom-background', array(
     101                                // Let WordPress know what our default background color is.
     102                                'default-color' => 'f1f1f1',
     103                        ) );
     104
     105                        // The custom header business starts here.
     106
     107                        $custom_header_support = array(
     108                        /*
     109                         * The default image to use.
     110                         * The %s is a placeholder for the theme template directory URI.
     111                         */
     112                        'default-image' => '%s/images/headers/path.jpg',
     113                        // The height and width of our custom header.
     114                        /**
    114115                 * Filter the Twenty Ten default header image width.
    115116                 *
    116117                 * @since Twenty Ten 1.0
    117118                 *
    118119                 * @param int The default header image width in pixels. Default 940.
    119120                 */
    120                 'width' => apply_filters( 'twentyten_header_image_width', 940 ),
    121                 /**
     121                        'width' => apply_filters( 'twentyten_header_image_width', 940 ),
     122                        /**
    122123                 * Filter the Twenty Ten defaul header image height.
    123124                 *
    124125                 * @since Twenty Ten 1.0
    125126                 *
    126127                 * @param int The default header image height in pixels. Default 198.
    127128                 */
    128                 'height' => apply_filters( 'twentyten_header_image_height', 198 ),
    129                 // Support flexible heights.
    130                 'flex-height' => true,
    131                 // Don't support text inside the header image.
    132                 'header-text' => false,
    133                 // Callback for styling the header preview in the admin.
    134                 'admin-head-callback' => 'twentyten_admin_header_style',
    135         );
    136 
    137         add_theme_support( 'custom-header', $custom_header_support );
    138 
    139         if ( ! function_exists( 'get_custom_header' ) ) {
    140                 // This is all for compatibility with versions of WordPress prior to 3.4.
    141                 define( 'HEADER_TEXTCOLOR', '' );
    142                 define( 'NO_HEADER_TEXT', true );
    143                 define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
    144                 define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
    145                 define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
    146                 add_custom_image_header( '', $custom_header_support['admin-head-callback'] );
    147                 add_custom_background();
    148         }
    149 
    150         /*
    151         * We'll be using post thumbnails for custom header images on posts and pages.
    152         * We want them to be 940 pixels wide by 198 pixels tall.
    153         * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
    154         */
    155         set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
    156 
    157         // ... and thus ends the custom header business.
    158 
    159         // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
    160         register_default_headers( array(
    161                 'berries' => array(
    162                         'url' => '%s/images/headers/berries.jpg',
    163                         'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg',
    164                         /* translators: header image description */
    165                         'description' => __( 'Berries', 'twentyten' )
    166                 ),
    167                 'cherryblossom' => array(
    168                         'url' => '%s/images/headers/cherryblossoms.jpg',
    169                         'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg',
    170                         /* translators: header image description */
    171                         'description' => __( 'Cherry Blossoms', 'twentyten' )
    172                 ),
    173                 'concave' => array(
    174                         'url' => '%s/images/headers/concave.jpg',
    175                         'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg',
    176                         /* translators: header image description */
    177                         'description' => __( 'Concave', 'twentyten' )
    178                 ),
    179                 'fern' => array(
    180                         'url' => '%s/images/headers/fern.jpg',
    181                         'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg',
    182                         /* translators: header image description */
    183                         'description' => __( 'Fern', 'twentyten' )
    184                 ),
    185                 'forestfloor' => array(
    186                         'url' => '%s/images/headers/forestfloor.jpg',
    187                         'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg',
    188                         /* translators: header image description */
    189                         'description' => __( 'Forest Floor', 'twentyten' )
    190                 ),
    191                 'inkwell' => array(
    192                         'url' => '%s/images/headers/inkwell.jpg',
    193                         'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg',
    194                         /* translators: header image description */
    195                         'description' => __( 'Inkwell', 'twentyten' )
    196                 ),
    197                 'path' => array(
    198                         'url' => '%s/images/headers/path.jpg',
    199                         'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg',
    200                         /* translators: header image description */
    201                         'description' => __( 'Path', 'twentyten' )
    202                 ),
    203                 'sunset' => array(
    204                         'url' => '%s/images/headers/sunset.jpg',
    205                         'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',
    206                         /* translators: header image description */
    207                         'description' => __( 'Sunset', 'twentyten' )
    208                 )
    209         ) );
    210 }
     129                        'height' => apply_filters( 'twentyten_header_image_height', 198 ),
     130                        // Support flexible heights.
     131                        'flex-height' => true,
     132                        // Don't support text inside the header image.
     133                        'header-text' => false,
     134                        // Callback for styling the header preview in the admin.
     135                        'admin-head-callback' => 'twentyten_admin_header_style',
     136                        );
     137
     138                        add_theme_support( 'custom-header', $custom_header_support );
     139
     140                if ( ! function_exists( 'get_custom_header' ) ) {
     141                        // This is all for compatibility with versions of WordPress prior to 3.4.
     142                        define( 'HEADER_TEXTCOLOR', '' );
     143                        define( 'NO_HEADER_TEXT', true );
     144                        define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
     145                        define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
     146                        define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
     147                        add_custom_image_header( '', $custom_header_support['admin-head-callback'] );
     148                        add_custom_background();
     149                }
     150
     151                        /*
     152                        * We'll be using post thumbnails for custom header images on posts and pages.
     153                        * We want them to be 940 pixels wide by 198 pixels tall.
     154                        * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     155                        */
     156                        set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
     157
     158                        // ... and thus ends the custom header business.
     159
     160                        // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
     161                        register_default_headers( array(
     162                                'berries' => array(
     163                                'url' => '%s/images/headers/berries.jpg',
     164                                'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg',
     165                                /* translators: header image description */
     166                                'description' => __( 'Berries', 'twentyten' ),
     167                                ),
     168                                'cherryblossom' => array(
     169                                'url' => '%s/images/headers/cherryblossoms.jpg',
     170                                'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg',
     171                                /* translators: header image description */
     172                                'description' => __( 'Cherry Blossoms', 'twentyten' ),
     173                                ),
     174                                'concave' => array(
     175                                'url' => '%s/images/headers/concave.jpg',
     176                                'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg',
     177                                /* translators: header image description */
     178                                'description' => __( 'Concave', 'twentyten' ),
     179                                ),
     180                                'fern' => array(
     181                                'url' => '%s/images/headers/fern.jpg',
     182                                'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg',
     183                                /* translators: header image description */
     184                                'description' => __( 'Fern', 'twentyten' ),
     185                                ),
     186                                'forestfloor' => array(
     187                                'url' => '%s/images/headers/forestfloor.jpg',
     188                                'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg',
     189                                /* translators: header image description */
     190                                'description' => __( 'Forest Floor', 'twentyten' ),
     191                                ),
     192                                'inkwell' => array(
     193                                'url' => '%s/images/headers/inkwell.jpg',
     194                                'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg',
     195                                /* translators: header image description */
     196                                'description' => __( 'Inkwell', 'twentyten' ),
     197                                ),
     198                                'path' => array(
     199                                'url' => '%s/images/headers/path.jpg',
     200                                'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg',
     201                                /* translators: header image description */
     202                                'description' => __( 'Path', 'twentyten' ),
     203                                ),
     204                                'sunset' => array(
     205                                'url' => '%s/images/headers/sunset.jpg',
     206                                'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',
     207                                /* translators: header image description */
     208                                'description' => __( 'Sunset', 'twentyten' ),
     209                                ),
     210                        ) );
     211        }
    211212endif;
    212213
    213214if ( ! function_exists( 'twentyten_admin_header_style' ) ) :
    214 /**
     215        /**
    215216 * Style the header image displayed on the Appearance > Header admin panel.
    216217 *
    217218 * Referenced via add_custom_image_header() in twentyten_setup().
    218219 *
    219220 * @since Twenty Ten 1.0
    220221 */
    221 function twentyten_admin_header_style() {
    222 ?>
    223 <style type="text/css" id="twentyten-admin-header-css">
    224 /* Shows the same border as on front end */
    225 #headimg {
    226         border-bottom: 1px solid #000;
    227         border-top: 4px solid #000;
    228 }
    229 /* If header-text was supported, you would style the text with these selectors:
    230         #headimg #name { }
    231         #headimg #desc { }
    232 */
    233 </style>
    234 <?php
    235 }
     222        function twentyten_admin_header_style() {
     223                ?>
     224                <style type="text/css" id="twentyten-admin-header-css">
     225                /* Shows the same border as on front end */
     226                #headimg {
     227                border-bottom: 1px solid #000;
     228                border-top: 4px solid #000;
     229                }
     230                /* If header-text was supported, you would style the text with these selectors:
     231                #headimg #name { }
     232                #headimg #desc { }
     233                */
     234                </style>
     235                <?php
     236        }
    236237endif;
    237238
    238239/**
     
    246247 * @param array $args An optional array of arguments. @see wp_page_menu()
    247248 */
    248249function twentyten_page_menu_args( $args ) {
    249         if ( ! isset( $args['show_home'] ) )
     250        if ( ! isset( $args['show_home'] ) ) {
    250251                $args['show_home'] = true;
     252        }
    251253        return $args;
    252254}
    253255add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' );
     
    269271add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
    270272
    271273if ( ! function_exists( 'twentyten_continue_reading_link' ) ) :
    272 /**
     274        /**
    273275 * Return a "Continue Reading" link for excerpts.
    274276 *
    275277 * @since Twenty Ten 1.0
    276278 *
    277279 * @return string "Continue Reading" link.
    278280 */
    279 function twentyten_continue_reading_link() {
    280         return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    281 }
     281        function twentyten_continue_reading_link() {
     282                return ' <a href="' . get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
     283        }
    282284endif;
    283285
    284286/**
     
    346348        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
    347349}
    348350// Backwards compatibility with WordPress 3.0.
    349 if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
     351if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) {
    350352        add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
     353}
    351354
    352355if ( ! function_exists( 'twentyten_comment' ) ) :
    353 /**
     356        /**
    354357 * Template for comments and pingbacks.
    355358 *
    356359 * To override this walker in a child theme without modifying the comments template
     
    364367 * @param array  $args    An array of arguments. @see get_comment_reply_link()
    365368 * @param int    $depth   The depth of the comment.
    366369 */
    367 function twentyten_comment( $comment, $args, $depth ) {
    368         $GLOBALS['comment'] = $comment;
    369         switch ( $comment->comment_type ) :
    370                 case '' :
    371         ?>
    372         <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
     370        function twentyten_comment( $comment, $args, $depth ) {
     371                $GLOBALS['comment'] = $comment;
     372                switch ( $comment->comment_type ) :
     373                        case '' :
     374                ?>
     375                <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    373376                <div id="comment-<?php comment_ID(); ?>">
    374377                        <div class="comment-author vcard">
    375378                                <?php echo get_avatar( $comment, 40 ); ?>
     
    385388                                        /* translators: 1: date, 2: time */
    386389                                        printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
    387390                                ?>
    388                         </div><!-- .comment-meta .commentmetadata -->
     391                                </div><!-- .comment-meta .commentmetadata -->
    389392
    390                         <div class="comment-body"><?php comment_text(); ?></div>
     393                                <div class="comment-body"><?php comment_text(); ?></div>
    391394
    392                         <div class="reply">
    393                                 <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    394                         </div><!-- .reply -->
    395                 </div><!-- #comment-##  -->
     395                                <div class="reply">
     396                                <?php comment_reply_link( array_merge( $args, array(
     397                                        'depth' => $depth,
     398                                        'max_depth' => $args['max_depth'],
     399                                ) ) ); ?>
     400                                </div><!-- .reply -->
     401                        </div><!-- #comment-##  -->
    396402
    397         <?php
     403                <?php
    398404                        break;
    399                 case 'pingback'  :
    400                 case 'trackback' :
    401         ?>
    402         <li class="post pingback">
     405                        case 'pingback'  :
     406                        case 'trackback' :
     407                ?>
     408                <li class="post pingback">
    403409                <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
    404410        <?php
    405411                        break;
    406         endswitch;
    407 }
     412                        endswitch;
     413        }
    408414endif;
    409415
    410416/**
     
    505511add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
    506512
    507513if ( ! function_exists( 'twentyten_posted_on' ) ) :
    508 /**
     514        /**
    509515 * Print HTML with meta information for the current post-date/time and author.
    510516 *
    511517 * @since Twenty Ten 1.0
    512518 */
    513 function twentyten_posted_on() {
    514         printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
    515                 'meta-prep meta-prep-author',
    516                 sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
    517                         get_permalink(),
    518                         esc_attr( get_the_time() ),
    519                         get_the_date()
    520                 ),
    521                 sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    522                         get_author_posts_url( get_the_author_meta( 'ID' ) ),
    523                         esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),
    524                         get_the_author()
    525                 )
    526         );
    527 }
     519        function twentyten_posted_on() {
     520                printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
     521                        'meta-prep meta-prep-author',
     522                        sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
     523                                get_permalink(),
     524                                esc_attr( get_the_time() ),
     525                                get_the_date()
     526                        ),
     527                        sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
     528                                get_author_posts_url( get_the_author_meta( 'ID' ) ),
     529                                esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),
     530                                get_the_author()
     531                        )
     532                );
     533        }
    528534endif;
    529535
    530536if ( ! function_exists( 'twentyten_posted_in' ) ) :
    531 /**
     537        /**
    532538 * Print HTML with meta information for the current post (category, tags and permalink).
    533539 *
    534540 * @since Twenty Ten 1.0
    535541 */
    536 function twentyten_posted_in() {
    537         // Retrieves tag list of current post, separated by commas.
    538         $tag_list = get_the_tag_list( '', ', ' );
    539         if ( $tag_list ) {
    540                 $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
    541         } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
    542                 $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
    543         } else {
    544                 $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
     542        function twentyten_posted_in() {
     543                // Retrieves tag list of current post, separated by commas.
     544                $tag_list = get_the_tag_list( '', ', ' );
     545                if ( $tag_list ) {
     546                        $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
     547                } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
     548                        $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
     549                } else {
     550                        $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' );
     551                }
     552                        // Prints the string, replacing the placeholders.
     553                        printf(
     554                                $posted_in,
     555                                get_the_category_list( ', ' ),
     556                                $tag_list,
     557                                get_permalink(),
     558                                the_title_attribute( 'echo=0' )
     559                        );
    545560        }
    546         // Prints the string, replacing the placeholders.
    547         printf(
    548                 $posted_in,
    549                 get_the_category_list( ', ' ),
    550                 $tag_list,
    551                 get_permalink(),
    552                 the_title_attribute( 'echo=0' )
    553         );
    554 }
    555561endif;
    556562
    557563/**
     
    569575
    570576        if ( function_exists( 'get_post_galleries' ) ) {
    571577                $galleries = get_post_galleries( get_the_ID(), false );
    572                 if ( isset( $galleries[0]['ids'] ) )
     578                if ( isset( $galleries[0]['ids'] ) ) {
    573579                        $images = explode( ',', $galleries[0]['ids'] );
     580                }
    574581        } else {
    575582                $pattern = get_shortcode_regex();
    576583                preg_match( "/$pattern/s", get_the_content(), $match );
    577584                $atts = shortcode_parse_atts( $match[3] );
    578                 if ( isset( $atts['ids'] ) )
     585                if ( isset( $atts['ids'] ) ) {
    579586                        $images = explode( ',', $atts['ids'] );
     587                }
    580588        }
    581589
    582590        if ( ! $images ) {
  • src/wp-content/themes/twentyten/header.php

     
    2525
    2626        // Add the blog description for the home/front page.
    2727        $site_description = get_bloginfo( 'description', 'display' );
    28         if ( $site_description && ( is_home() || is_front_page() ) )
    29                 echo " | $site_description";
     28if ( $site_description && ( is_home() || is_front_page() ) ) {
     29        echo " | $site_description";
     30}
    3031
    3132        // Add a page number if necessary:
    32         if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
    33                 echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) );
     33if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
     34        echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) );
     35}
    3436
    3537        ?></title>
    3638<link rel="profile" href="http://gmpg.org/xfn/11" />
     
    4143         * We add some JavaScript to pages with the comment form
    4244         * to support sites with threaded comments (when in use).
    4345         */
    44         if ( is_singular() && get_option( 'thread_comments' ) )
    45                 wp_enqueue_script( 'comment-reply' );
     46if ( is_singular() && get_option( 'thread_comments' ) ) {
     47        wp_enqueue_script( 'comment-reply' );
     48}
    4649
    4750        /*
    4851         * Always have wp_head() just before the closing </head>
     
    6972
    7073                                <?php
    7174                                        // Compatibility with versions of WordPress prior to 3.4.
    72                                         if ( function_exists( 'get_custom_header' ) ) {
    73                                                 /*
    74                                                  * We need to figure out what the minimum width should be for our featured image.
    75                                                  * This result would be the suggested width if the theme were to implement flexible widths.
    76                                                  */
    77                                                 $header_image_width = get_theme_support( 'custom-header', 'width' );
    78                                         } else {
    79                                                 $header_image_width = HEADER_IMAGE_WIDTH;
    80                                         }
     75                                if ( function_exists( 'get_custom_header' ) ) {
     76                                        /*
     77                                        * We need to figure out what the minimum width should be for our featured image.
     78                                        * This result would be the suggested width if the theme were to implement flexible widths.
     79                                        */
     80                                        $header_image_width = get_theme_support( 'custom-header', 'width' );
     81                                } else {
     82                                        $header_image_width = HEADER_IMAGE_WIDTH;
     83                                }
    8184
    8285                                        // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    83                                         if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
     86                                if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    8487                                                        has_post_thumbnail( $post->ID ) &&
    8588                                                        ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    8689                                                        $image[1] >= $header_image_width ) :
    87                                                 // Houston, we have a new header image!
    88                                                 echo get_the_post_thumbnail( $post->ID );
     90                                        // Houston, we have a new header image!
     91                                        echo get_the_post_thumbnail( $post->ID );
    8992                                        elseif ( get_header_image() ) :
    9093                                                // Compatibility with versions of WordPress prior to 3.4.
    9194                                                if ( function_exists( 'get_custom_header' ) ) {
     
    101104                        </div><!-- #branding -->
    102105
    103106                        <div id="access" role="navigation">
    104                           <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
     107                                <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    105108                                <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    106109                                <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    107110                                <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  • src/wp-content/themes/twentyten/loop-attachment.php

     
    1515 */
    1616?>
    1717
    18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
     18<?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?>
    1919
    2020                                <?php if ( ! empty( $post->post_parent ) ) : ?>
    2121                                        <p class="page-title"><a href="<?php echo esc_url( get_permalink( $post->post_parent ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'Return to %s', 'twentyten' ), strip_tags( get_the_title( $post->post_parent ) ) ) ); ?>" rel="gallery"><?php
     
    4747                                                                        get_the_date()
    4848                                                                )
    4949                                                        );
    50                                                         if ( wp_attachment_is_image() ) {
    51                                                                 echo ' <span class="meta-sep">|</span> ';
    52                                                                 $metadata = wp_get_attachment_metadata();
    53                                                                 printf( __( 'Full size is %s pixels', 'twentyten' ),
    54                                                                         sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
    55                                                                                 esc_url( wp_get_attachment_url() ),
    56                                                                                 esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
    57                                                                                 $metadata['width'],
    58                                                                                 $metadata['height']
    59                                                                         )
    60                                                                 );
    61                                                         }
     50                                                if ( wp_attachment_is_image() ) {
     51                                                        echo ' <span class="meta-sep">|</span> ';
     52                                                        $metadata = wp_get_attachment_metadata();
     53                                                        printf( __( 'Full size is %s pixels', 'twentyten' ),
     54                                                                sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
     55                                                                        esc_url( wp_get_attachment_url() ),
     56                                                                        esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
     57                                                                        $metadata['width'],
     58                                                                        $metadata['height']
     59                                                                )
     60                                                        );
     61                                                }
    6262                                                ?>
    6363                                                <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    6464                                        </div><!-- .entry-meta -->
     
    6666                                        <div class="entry-content">
    6767                                                <div class="entry-attachment">
    6868<?php if ( wp_attachment_is_image() ) :
    69         $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
     69        $attachments = array_values( get_children( array(
     70                'post_parent' => $post->post_parent,
     71                'post_status' => 'inherit',
     72                'post_type' => 'attachment',
     73                'post_mime_type' => 'image',
     74                'order' => 'ASC',
     75                'orderby' => 'menu_order ID',
     76        ) ) );
    7077        foreach ( $attachments as $k => $attachment ) {
    71                 if ( $attachment->ID == $post->ID )
     78                if ( $attachment->ID == $post->ID ) {
    7279                        break;
     80                }
    7381        }
    7482
    7583        // If there is more than 1 image attachment in a gallery
    7684        if ( count( $attachments ) > 1 ) {
    7785                $k++;
    78                 if ( isset( $attachments[ $k ] ) )
     86                if ( isset( $attachments[ $k ] ) ) {
    7987                        // get the URL of the next image attachment
    8088                        $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    81                 else
    82                         // or get the URL of the first image attachment
     89                } else { // End if().
    8390                        $next_attachment_url = get_attachment_link( $attachments[0]->ID );
     91                }
    8492        } else {
    8593                // or, if there's only 1 image attachment, get the URL of the image
    8694                $next_attachment_url = wp_get_attachment_url();
     
    114122                                                <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a>
    115123<?php endif; ?>
    116124                                                </div><!-- .entry-attachment -->
    117                                                 <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
     125                                                <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) { the_excerpt();} ?></div>
    118126
    119127<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    120 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
     128<?php wp_link_pages( array(
     129        'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ),
     130        'after' => '</div>',
     131) ); ?>
    121132
    122133                                        </div><!-- .entry-content -->
    123134
     
    129140
    130141<?php comments_template(); ?>
    131142
    132 <?php endwhile; // end of the loop. ?>
     143<?php endwhile;
     144}; // End if().
     145?>
  • src/wp-content/themes/twentyten/loop-page.php

     
    1515 */
    1616?>
    1717
    18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
     18<?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?>
    1919
    2020                                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2121                                        <?php if ( is_front_page() ) { ?>
     
    2626
    2727                                        <div class="entry-content">
    2828                                                <?php the_content(); ?>
    29                                                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
     29                                                <?php wp_link_pages( array(
     30                                                        'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ),
     31                                                        'after' => '</div>',
     32                                                ) ); ?>
    3033                                                <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
    3134                                        </div><!-- .entry-content -->
    3235                                </div><!-- #post-## -->
    3336
    3437                                <?php comments_template( '', true ); ?>
    3538
    36 <?php endwhile; // end of the loop. ?>
     39<?php endwhile;
     40}; // End if().
     41?>
  • src/wp-content/themes/twentyten/loop-single.php

     
    1515 */
    1616?>
    1717
    18 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
     18<?php if ( have_posts() ) { while ( have_posts() ) : the_post(); ?>
    1919
    2020                                <div id="nav-above" class="navigation">
    2121                                        <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
     
    3131
    3232                                        <div class="entry-content">
    3333                                                <?php the_content(); ?>
    34                                                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
     34                                                <?php wp_link_pages( array(
     35                                                        'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ),
     36                                                        'after' => '</div>',
     37                                                ) ); ?>
    3538                                        </div><!-- .entry-content -->
    3639
    3740<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries  ?>
     
    6770
    6871                                <?php comments_template( '', true ); ?>
    6972
    70 <?php endwhile; // end of the loop. ?>
     73<?php endwhile;
     74}; // End if().
     75?>
  • src/wp-content/themes/twentyten/loop.php

     
    7373<?php else : ?>
    7474                                <?php
    7575                                        $images = twentyten_get_gallery_images();
    76                                         if ( $images ) :
    77                                                 $total_images = count( $images );
    78                                                 $image = reset( $images );
     76                                if ( $images ) :
     77                                        $total_images = count( $images );
     78                                        $image = reset( $images );
    7979                                ?>
    80                                                 <div class="gallery-thumb">
    81                                                         <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
    82                                                 </div><!-- .gallery-thumb -->
    83                                                 <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ),
    84                                                                 'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
    85                                                                 number_format_i18n( $total_images )
    86                                                         ); ?></em></p>
     80                                <div class="gallery-thumb">
     81                                        <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
     82                                </div><!-- .gallery-thumb -->
     83                                <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ),
     84                                        'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
     85                                        number_format_i18n( $total_images )
     86                                           ); ?></em></p>
    8787                                <?php endif; // end twentyten_get_gallery_images() check ?>
    8888                                                <?php the_excerpt(); ?>
    8989<?php endif; ?>
     
    104104
    105105<?php /* How to display posts of the Aside format. The asides category is the old way. */ ?>
    106106
    107         <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) )  ) : ?>
     107        <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?>
    108108                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    109109
    110110                <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
     
    142142        <?php else : ?>
    143143                        <div class="entry-content">
    144144                                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    145                                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
     145                                <?php wp_link_pages( array(
     146                                        'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ),
     147                                        'after' => '</div>',
     148                                ) ); ?>
    146149                        </div><!-- .entry-content -->
    147150        <?php endif; ?>
    148151
     
    155158                                <?php endif; ?>
    156159                                <?php
    157160                                        $tags_list = get_the_tag_list( '', ', ' );
    158                                         if ( $tags_list ):
     161                                if ( $tags_list ) :
    159162                                ?>
    160                                         <span class="tag-links">
    161                                                 <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    162                                         </span>
    163                                         <span class="meta-sep">|</span>
     163                                <span class="tag-links">
     164                                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
     165                                </span>
     166                                <span class="meta-sep">|</span>
    164167                                <?php endif; ?>
    165168                                <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    166169                                <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
     
    174177<?php endwhile; // End the loop. Whew. ?>
    175178
    176179<?php /* Display navigation to next/previous pages when applicable */ ?>
    177 <?php if (  $wp_query->max_num_pages > 1 ) : ?>
     180<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    178181                                <div id="nav-below" class="navigation">
    179182                                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    180183                                        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  • src/wp-content/themes/twentyten/sidebar-footer.php

     
    1515         *
    1616         * If none of the sidebars have widgets, then let's bail early.
    1717         */
    18         if (   ! is_active_sidebar( 'first-footer-widget-area' )
     18if ( ! is_active_sidebar( 'first-footer-widget-area' )
    1919                && ! is_active_sidebar( 'second-footer-widget-area' )
    20                 && ! is_active_sidebar( 'third-footer-widget-area'  )
     20                && ! is_active_sidebar( 'third-footer-widget-area' )
    2121                && ! is_active_sidebar( 'fourth-footer-widget-area' )
    22         )
    23                 return;
     22        ) {
     23        return;
     24}
    2425        // If we get this far, we have widgets. Let do this.
    2526?>
    2627
  • src/wp-content/themes/twentyten/sidebar.php

     
    1818         * then the sidebar simply doesn't exist, so we'll hard-code in
    1919         * some default sidebar stuff just in case.
    2020         */
    21         if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
     21if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
    2222
    2323                        <li id="search" class="widget-container widget_search">
    2424                                <?php get_search_form(); ?>
     
    4646
    4747<?php
    4848        // A second sidebar for widgets, just because.
    49         if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
     49if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
    5050
    5151                <div id="secondary" class="widget-area" role="complementary">
    5252                        <ul class="xoxo">
  • src/wp-content/themes/twentythirteen/404.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/twentythirteen/archive.php

     
    2525                <?php if ( have_posts() ) : ?>
    2626                        <header class="archive-header">
    2727                                <h1 class="archive-title"><?php
    28                                         if ( is_day() ) :
    29                                                 printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() );
     28                                if ( is_day() ) :
     29                                        printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() );
    3030                                        elseif ( is_month() ) :
    3131                                                printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) );
    3232                                        elseif ( is_year() ) :
  • src/wp-content/themes/twentythirteen/author-bio.php

     
    3131                        </a>
    3232                </p>
    3333        </div><!-- .author-description -->
    34 </div><!-- .author-info -->
    35  No newline at end of file
     34</div><!-- .author-info -->
  • src/wp-content/themes/twentythirteen/comments.php

     
    1313 * If the current post is protected by a password and the visitor has not yet
    1414 * entered the password we will return early without loading the comments.
    1515 */
    16 if ( post_password_required() )
     16if ( post_password_required() ) {
    1717        return;
     18}
    1819?>
    1920
    2021<div id="comments" class="comments-area">
     
    2324                <h2 class="comments-title">
    2425                        <?php
    2526                                printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ),
    26                                         number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
     27                                number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
    2728                        ?>
    2829                </h2>
    2930
     
    3940
    4041                <?php
    4142                        // Are there comments to navigate through?
    42                         if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
     43                if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
    4344                ?>
    4445                <nav class="navigation comment-navigation" role="navigation">
    45                         <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
    46                         <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
    47                         <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
     46                <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
     47                <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
     48                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
    4849                </nav><!-- .comment-navigation -->
    4950                <?php endif; // Check for comment navigation ?>
    5051
     
    5657
    5758        <?php comment_form(); ?>
    5859
    59 </div><!-- #comments -->
    60  No newline at end of file
     60</div><!-- #comments -->
  • src/wp-content/themes/twentythirteen/content.php

     
    4545                                the_title( '<span class="screen-reader-text">', '</span>', false )
    4646                        ) );
    4747
    48                         wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
     48                        wp_link_pages( array(
     49                                'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>',
     50                                'after' => '</div>',
     51                                'link_before' => '<span>',
     52                                'link_after' => '</span>',
     53                        ) );
    4954                ?>
    5055        </div><!-- .entry-content -->
    5156        <?php endif; ?>
  • src/wp-content/themes/twentythirteen/footer.php

     
    2323
    2424        <?php wp_footer(); ?>
    2525</body>
    26 </html>
    27  No newline at end of file
     26</html>
  • src/wp-content/themes/twentythirteen/functions.php

     
    2828 *
    2929 * @see twentythirteen_content_width() for template-specific adjustments.
    3030 */
    31 if ( ! isset( $content_width ) )
     31if ( ! isset( $content_width ) ) {
    3232        $content_width = 604;
     33}
    3334
    3435/**
    3536 * Add support for a custom header image.
     
    3940/**
    4041 * Twenty Thirteen only works in WordPress 3.6 or later.
    4142 */
    42 if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) )
     43if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) ) {
    4344        require get_template_directory() . '/inc/back-compat.php';
     45}
    4446
    4547/**
    4648 * Twenty Thirteen setup.
     
    8284         * and comments to output valid HTML5.
    8385         */
    8486        add_theme_support( 'html5', array(
    85                 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
     87                'search-form',
     88                'comment-form',
     89                'comment-list',
     90                'gallery',
     91                'caption',
    8692        ) );
    8793
    8894        /*
     
    9096         * See https://codex.wordpress.org/Post_Formats
    9197         */
    9298        add_theme_support( 'post-formats', array(
    93                 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
     99                'aside',
     100                'audio',
     101                'chat',
     102                'gallery',
     103                'image',
     104                'link',
     105                'quote',
     106                'status',
     107                'video',
    94108        ) );
    95109
    96110        // This theme uses wp_nav_menu() in one location.
     
    139153        if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {
    140154                $font_families = array();
    141155
    142                 if ( 'off' !== $source_sans_pro )
     156                if ( 'off' !== $source_sans_pro ) {
    143157                        $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';
     158                }
    144159
    145                 if ( 'off' !== $bitter )
     160                if ( 'off' !== $bitter ) {
    146161                        $font_families[] = 'Bitter:400,700';
     162                }
    147163
    148164                $query_args = array(
    149165                        'family' => urlencode( implode( '|', $font_families ) ),
     
    165181         * Adds JavaScript to pages with the comment form to support
    166182         * sites with threaded comments (when in use).
    167183         */
    168         if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
     184        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    169185                wp_enqueue_script( 'comment-reply' );
     186        }
    170187
    171188        // Adds Masonry to handle vertical alignment of footer widgets.
    172         if ( is_active_sidebar( 'sidebar-1' ) )
     189        if ( is_active_sidebar( 'sidebar-1' ) ) {
    173190                wp_enqueue_script( 'jquery-masonry' );
     191        }
    174192
    175193        // Loads JavaScript file with functionality specific to Twenty Thirteen.
    176194        wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true );
     
    230248function twentythirteen_wp_title( $title, $sep ) {
    231249        global $paged, $page;
    232250
    233         if ( is_feed() )
     251        if ( is_feed() ) {
    234252                return $title;
     253        }
    235254
    236255        // Add the site name.
    237256        $title .= get_bloginfo( 'name', 'display' );
    238257
    239258        // Add the site description for the home/front page.
    240259        $site_description = get_bloginfo( 'description', 'display' );
    241         if ( $site_description && ( is_home() || is_front_page() ) )
     260        if ( $site_description && ( is_home() || is_front_page() ) ) {
    242261                $title = "$title $sep $site_description";
     262        }
    243263
    244264        // Add a page number if necessary.
    245         if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
     265        if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
    246266                $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );
     267        }
    247268
    248269        return $title;
    249270}
     
    278299add_action( 'widgets_init', 'twentythirteen_widgets_init' );
    279300
    280301if ( ! function_exists( 'twentythirteen_paging_nav' ) ) :
    281 /**
     302        /**
    282303 * Display navigation to next/previous set of posts when applicable.
    283304 *
    284305 * @since Twenty Thirteen 1.0
    285306 */
    286 function twentythirteen_paging_nav() {
    287         global $wp_query;
     307        function twentythirteen_paging_nav() {
     308                global $wp_query;
    288309
    289         // Don't print empty markup if there's only one page.
    290         if ( $wp_query->max_num_pages < 2 )
    291                 return;
    292         ?>
    293         <nav class="navigation paging-navigation" role="navigation">
     310                // Don't print empty markup if there's only one page.
     311                if ( $wp_query->max_num_pages < 2 ) {
     312                        return;
     313                }
     314                ?>
     315                <nav class="navigation paging-navigation" role="navigation">
    294316                <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
    295317                <div class="nav-links">
    296318
     
    303325                        <?php endif; ?>
    304326
    305327                </div><!-- .nav-links -->
    306         </nav><!-- .navigation -->
    307         <?php
    308 }
     328                </nav><!-- .navigation -->
     329                <?php
     330        }
    309331endif;
    310332
    311333if ( ! function_exists( 'twentythirteen_post_nav' ) ) :
    312 /**
     334        /**
    313335 * Display navigation to next/previous post when applicable.
    314336 *
    315337 * @since Twenty Thirteen 1.0
    316338 */
    317 function twentythirteen_post_nav() {
    318         global $post;
     339        function twentythirteen_post_nav() {
     340                global $post;
    319341
    320         // Don't print empty markup if there's nowhere to navigate.
    321         $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
    322         $next     = get_adjacent_post( false, '', false );
    323 
    324         if ( ! $next && ! $previous )
    325                 return;
    326         ?>
    327         <nav class="navigation post-navigation" role="navigation">
     342                // Don't print empty markup if there's nowhere to navigate.
     343                $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
     344                $next     = get_adjacent_post( false, '', false );
     345
     346                if ( ! $next && ! $previous ) {
     347                        return;
     348                }
     349                ?>
     350                <nav class="navigation post-navigation" role="navigation">
    328351                <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
    329352                <div class="nav-links">
    330353
     
    332355                        <?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen' ) ); ?>
    333356
    334357                </div><!-- .nav-links -->
    335         </nav><!-- .navigation -->
    336         <?php
    337 }
     358                </nav><!-- .navigation -->
     359                <?php
     360        }
    338361endif;
    339362
    340363if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
    341 /**
     364        /**
    342365 * Print HTML with meta information for current post: categories, tags, permalink, author, and date.
    343366 *
    344367 * Create your own twentythirteen_entry_meta() to override in a child theme.
    345368 *
    346369 * @since Twenty Thirteen 1.0
    347370 */
    348 function twentythirteen_entry_meta() {
    349         if ( is_sticky() && is_home() && ! is_paged() )
    350                 echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
    351 
    352         if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
    353                 twentythirteen_entry_date();
    354 
    355         // Translators: used between list items, there is a space after the comma.
    356         $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
    357         if ( $categories_list ) {
    358                 echo '<span class="categories-links">' . $categories_list . '</span>';
    359         }
    360 
    361         // Translators: used between list items, there is a space after the comma.
    362         $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
    363         if ( $tag_list ) {
    364                 echo '<span class="tags-links">' . $tag_list . '</span>';
    365         }
    366 
    367         // Post author
    368         if ( 'post' == get_post_type() ) {
    369                 printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
    370                         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    371                         esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),
    372                         get_the_author()
    373                 );
     371        function twentythirteen_entry_meta() {
     372                if ( is_sticky() && is_home() && ! is_paged() ) {
     373                        echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
     374                }
     375
     376                if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) {
     377                        twentythirteen_entry_date();
     378                }
     379
     380                // Translators: used between list items, there is a space after the comma.
     381                $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
     382                if ( $categories_list ) {
     383                        echo '<span class="categories-links">' . $categories_list . '</span>';
     384                }
     385
     386                // Translators: used between list items, there is a space after the comma.
     387                $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
     388                if ( $tag_list ) {
     389                        echo '<span class="tags-links">' . $tag_list . '</span>';
     390                }
     391
     392                // Post author
     393                if ( 'post' == get_post_type() ) {
     394                        printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
     395                                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     396                                esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),
     397                                get_the_author()
     398                        );
     399                }
    374400        }
    375 }
    376401endif;
    377402
    378403if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
    379 /**
     404        /**
    380405 * Print HTML with date information for current post.
    381406 *
    382407 * Create your own twentythirteen_entry_date() to override in a child theme.
     
    386411 * @param boolean $echo (optional) Whether to echo the date. Default true.
    387412 * @return string The HTML-formatted post date.
    388413 */
    389 function twentythirteen_entry_date( $echo = true ) {
    390         if ( has_post_format( array( 'chat', 'status' ) ) )
    391                 $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
    392         else
    393                 $format_prefix = '%2$s';
    394 
    395         $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
    396                 esc_url( get_permalink() ),
    397                 esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
    398                 esc_attr( get_the_date( 'c' ) ),
    399                 esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
    400         );
     414        function twentythirteen_entry_date( $echo = true ) {
     415                if ( has_post_format( array( 'chat', 'status' ) ) ) {
     416                        $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
     417                } else { $format_prefix = '%2$s';
     418                }
    401419
    402         if ( $echo )
    403                 echo $date;
     420                $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
     421                        esc_url( get_permalink() ),
     422                        esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
     423                        esc_attr( get_the_date( 'c' ) ),
     424                        esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
     425                );
    404426
    405         return $date;
    406 }
     427                if ( $echo ) {
     428                        echo $date;
     429                }
     430
     431                        return $date;
     432        }
    407433endif;
    408434
    409435if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) :
    410 /**
     436        /**
    411437 * Print the attached image with a link to the next attached image.
    412438 *
    413439 * @since Twenty Thirteen 1.0
    414440 */
    415 function twentythirteen_the_attached_image() {
    416         /**
     441        function twentythirteen_the_attached_image() {
     442                /**
    417443         * Filter the image attachment size to use.
    418444         *
    419445         * @since Twenty thirteen 1.0
     
    423449         *     @type int The attachment width in pixels.
    424450         * }
    425451         */
    426         $attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );
    427         $next_attachment_url = wp_get_attachment_url();
    428         $post                = get_post();
     452                $attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );
     453                $next_attachment_url = wp_get_attachment_url();
     454                $post                = get_post();
     455
     456                /*
     457                 * Grab the IDs of all the image attachments in a gallery so we can get the URL
     458                 * of the next adjacent image in a gallery, or the first image (if we're
     459                 * looking at the last image in a gallery), or, in a gallery of one, just the
     460                 * link to that image file.
     461                 */
     462                $attachment_ids = get_posts( array(
     463                        'post_parent'    => $post->post_parent,
     464                        'fields'         => 'ids',
     465                        'numberposts'    => -1,
     466                        'post_status'    => 'inherit',
     467                        'post_type'      => 'attachment',
     468                        'post_mime_type' => 'image',
     469                        'order'          => 'ASC',
     470                        'orderby'        => 'menu_order ID',
     471                ) );
    429472
    430         /*
    431          * Grab the IDs of all the image attachments in a gallery so we can get the URL
    432          * of the next adjacent image in a gallery, or the first image (if we're
    433          * looking at the last image in a gallery), or, in a gallery of one, just the
    434          * link to that image file.
    435          */
    436         $attachment_ids = get_posts( array(
    437                 'post_parent'    => $post->post_parent,
    438                 'fields'         => 'ids',
    439                 'numberposts'    => -1,
    440                 'post_status'    => 'inherit',
    441                 'post_type'      => 'attachment',
    442                 'post_mime_type' => 'image',
    443                 'order'          => 'ASC',
    444                 'orderby'        => 'menu_order ID',
    445         ) );
     473                        // If there is more than 1 attachment in a gallery...
     474                if ( count( $attachment_ids ) > 1 ) {
     475                        foreach ( $attachment_ids as $idx => $attachment_id ) {
     476                                if ( $attachment_id == $post->ID ) {
     477                                        $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
     478                                        break;
     479                                }
     480                        }
    446481
    447         // If there is more than 1 attachment in a gallery...
    448         if ( count( $attachment_ids ) > 1 ) {
    449                 foreach ( $attachment_ids as $idx => $attachment_id ) {
    450                         if ( $attachment_id == $post->ID ) {
    451                                 $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
    452                                 break;
     482                        // get the URL of the next image attachment...
     483                        if ( $next_id ) {
     484                                $next_attachment_url = get_attachment_link( $next_id );
     485                        } // End if().
     486                        else {                                  $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
    453487                        }
    454488                }
    455489
    456                 // get the URL of the next image attachment...
    457                 if ( $next_id )
    458                         $next_attachment_url = get_attachment_link( $next_id );
    459 
    460                 // or get the URL of the first image attachment.
    461                 else
    462                         $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
     490                        printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
     491                                esc_url( $next_attachment_url ),
     492                                the_title_attribute( array(
     493                                        'echo' => false,
     494                                ) ),
     495                                wp_get_attachment_image( $post->ID, $attachment_size )
     496                        );
    463497        }
    464 
    465         printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
    466                 esc_url( $next_attachment_url ),
    467                 the_title_attribute( array( 'echo' => false ) ),
    468                 wp_get_attachment_image( $post->ID, $attachment_size )
    469         );
    470 }
    471498endif;
    472499
    473500/**
     
    490517}
    491518
    492519if ( ! function_exists( 'twentythirteen_excerpt_more' ) && ! is_admin() ) :
    493 /**
     520        /**
    494521 * Replaces "[...]" (appended to automatically generated excerpts) with ...
    495522 * and a Continue reading link.
    496523 *
     
    499526 * @param string $more Default Read More excerpt link.
    500527 * @return string Filtered Read More excerpt link.
    501528 */
    502 function twentythirteen_excerpt_more( $more ) {
    503         $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
    504                 esc_url( get_permalink( get_the_ID() ) ),
     529        function twentythirteen_excerpt_more( $more ) {
     530                $link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
     531                        esc_url( get_permalink( get_the_ID() ) ),
    505532                        /* translators: %s: Name of current post */
    506533                        sprintf( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
    507534                );
    508         return ' &hellip; ' . $link;
    509 }
    510 add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );
     535                        return ' &hellip; ' . $link;
     536        }
     537        add_filter( 'excerpt_more', 'twentythirteen_excerpt_more' );
    511538endif;
    512539
    513540/**
     
    524551 * @return array The filtered body class list.
    525552 */
    526553function twentythirteen_body_class( $classes ) {
    527         if ( ! is_multi_author() )
     554        if ( ! is_multi_author() ) {
    528555                $classes[] = 'single-author';
     556        }
    529557
    530         if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )
     558        if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) {
    531559                $classes[] = 'sidebar';
     560        }
    532561
    533         if ( ! get_option( 'show_avatars' ) )
     562        if ( ! get_option( 'show_avatars' ) ) {
    534563                $classes[] = 'no-avatars';
     564        }
    535565
    536566        return $classes;
    537567}
     
    545575function twentythirteen_content_width() {
    546576        global $content_width;
    547577
    548         if ( is_attachment() )
     578        if ( is_attachment() ) {
    549579                $content_width = 724;
    550         elseif ( has_post_format( 'audio' ) )
     580        } elseif ( has_post_format( 'audio' ) ) {
    551581                $content_width = 484;
     582        }
    552583}
    553584add_action( 'template_redirect', 'twentythirteen_content_width' );
    554585
  • src/wp-content/themes/twentythirteen/image.php

     
    1616
    1717                        <?php
    1818                                // Start the Loop.
    19                                 while ( have_posts() ) : the_post();
     19                        while ( have_posts() ) : the_post();
    2020                        ?>
    2121
    2222                        <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
    23                                 <header class="entry-header">
    24                                         <h1 class="entry-title"><?php the_title(); ?></h1>
     23                        <header class="entry-header">
     24                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2525
    26                                         <div class="entry-meta">
    27                                                 <?php
    28                                                         $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
    29                                                         $post_title = get_the_title( $post->post_parent );
    30                                                         if ( empty( $post_title ) || 0 == $post->post_parent )
    31                                                                 $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
    32 
    33                                                         printf( $published_text,
    34                                                                 esc_attr( get_the_date( 'c' ) ),
    35                                                                 esc_html( get_the_date() ),
    36                                                                 esc_url( get_permalink( $post->post_parent ) ),
    37                                                                 esc_attr( strip_tags( $post_title ) ),
    38                                                                 $post_title
    39                                                         );
    40 
    41                                                         $metadata = wp_get_attachment_metadata();
    42                                                         printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
    43                                                                 esc_url( wp_get_attachment_url() ),
    44                                                                 esc_attr__( 'Link to full-size image', 'twentythirteen' ),
    45                                                                 __( 'Full resolution', 'twentythirteen' ),
    46                                                                 $metadata['width'],
    47                                                                 $metadata['height']
    48                                                         );
    49 
    50                                                         edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
    51                                                 ?>
    52                                         </div><!-- .entry-meta -->
     26                        <div class="entry-meta">
     27                                <?php
     28                                        $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
     29                                        $post_title = get_the_title( $post->post_parent );
     30                                if ( empty( $post_title ) || 0 == $post->post_parent ) {
     31                                        $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
     32                                }
     33
     34                                        printf( $published_text,
     35                                                esc_attr( get_the_date( 'c' ) ),
     36                                                esc_html( get_the_date() ),
     37                                                esc_url( get_permalink( $post->post_parent ) ),
     38                                                esc_attr( strip_tags( $post_title ) ),
     39                                                $post_title
     40                                        );
     41
     42                                        $metadata = wp_get_attachment_metadata();
     43                                        printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
     44                                                esc_url( wp_get_attachment_url() ),
     45                                                esc_attr__( 'Link to full-size image', 'twentythirteen' ),
     46                                                __( 'Full resolution', 'twentythirteen' ),
     47                                                $metadata['width'],
     48                                                $metadata['height']
     49                                        );
     50
     51                                        edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
     52                                ?>
     53                                </div><!-- .entry-meta -->
    5354                                </header><!-- .entry-header -->
    5455
    5556                                <div class="entry-content">
    56                                         <nav id="image-navigation" class="navigation image-navigation" role="navigation">
    57                                                 <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
    58                                                 <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
     57                                <nav id="image-navigation" class="navigation image-navigation" role="navigation">
     58                                <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
     59                                        <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
    5960                                        </nav><!-- #image-navigation -->
    6061
    6162                                        <div class="entry-attachment">
    62                                                 <div class="attachment">
    63                                                         <?php twentythirteen_the_attached_image(); ?>
     63                                        <div class="attachment">
     64                                        <?php twentythirteen_the_attached_image(); ?>
    6465
    65                                                         <?php if ( has_excerpt() ) : ?>
     66                                        <?php if ( has_excerpt() ) : ?>
    6667                                                        <div class="entry-caption">
    6768                                                                <?php the_excerpt(); ?>
    6869                                                        </div>
    6970                                                        <?php endif; ?>
    70                                                 </div><!-- .attachment -->
     71                                        </div><!-- .attachment -->
    7172                                        </div><!-- .entry-attachment -->
    7273
    7374                                        <?php if ( ! empty( $post->post_content ) ) : ?>
    7475                                        <div class="entry-description">
    7576                                                <?php the_content(); ?>
    76                                                 <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?>
     77                                                <?php wp_link_pages( array(
     78                                                        'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ),
     79                                                        'after' => '</div>',
     80                                                ) ); ?>
    7781                                        </div><!-- .entry-description -->
    7882                                        <?php endif; ?>
    7983
  • src/wp-content/themes/twentythirteen/inc/custom-header.php

     
    4646                'circle' => array(
    4747                        'url'           => '%s/images/headers/circle.png',
    4848                        'thumbnail_url' => '%s/images/headers/circle-thumbnail.png',
    49                         'description'   => _x( 'Circle', 'header image description', 'twentythirteen' )
     49                        'description'   => _x( 'Circle', 'header image description', 'twentythirteen' ),
    5050                ),
    5151                'diamond' => array(
    5252                        'url'           => '%s/images/headers/diamond.png',
    5353                        'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png',
    54                         'description'   => _x( 'Diamond', 'header image description', 'twentythirteen' )
     54                        'description'   => _x( 'Diamond', 'header image description', 'twentythirteen' ),
    5555                ),
    5656                'star' => array(
    5757                        'url'           => '%s/images/headers/star.png',
    5858                        'thumbnail_url' => '%s/images/headers/star-thumbnail.png',
    59                         'description'   => _x( 'Star', 'header image description', 'twentythirteen' )
     59                        'description'   => _x( 'Star', 'header image description', 'twentythirteen' ),
    6060                ),
    6161        ) );
    6262}
     
    8888        $text_color   = get_header_textcolor();
    8989
    9090        // If no custom options for text are set, let's bail.
    91         if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
     91        if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
    9292                return;
     93        }
    9394
    9495        // If we get this far, we have custom styles.
    9596        ?>
    9697        <style type="text/css" id="twentythirteen-header-css">
    9798        <?php
    98                 if ( ! empty( $header_image ) ) :
     99        if ( ! empty( $header_image ) ) :
    99100        ?>
    100                 .site-header {
    101                         background: url(<?php header_image(); ?>) no-repeat scroll top;
    102                         background-size: 1600px auto;
    103                 }
    104                 @media (max-width: 767px) {
    105                         .site-header {
    106                                 background-size: 768px auto;
    107                         }
    108                 }
    109                 @media (max-width: 359px) {
    110                         .site-header {
    111                                 background-size: 360px auto;
    112                         }
    113                 }
     101        .site-header {
     102        background: url(<?php header_image(); ?>) no-repeat scroll top;
     103        background-size: 1600px auto;
     104        }
     105        @media (max-width: 767px) {
     106        .site-header {
     107                background-size: 768px auto;
     108        }
     109        }
     110        @media (max-width: 359px) {
     111        .site-header {
     112                background-size: 360px auto;
     113        }
     114        }
    114115        <?php
    115116                endif;
    116117
    117118                // Has the text been hidden?
    118                 if ( ! display_header_text() ) :
     119        if ( ! display_header_text() ) :
    119120        ?>
    120                 .site-title,
    121                 .site-description {
    122                         position: absolute;
    123                         clip: rect(1px 1px 1px 1px); /* IE7 */
    124                         clip: rect(1px, 1px, 1px, 1px);
    125                 }
     121        .site-title,
     122        .site-description {
     123        position: absolute;
     124        clip: rect(1px 1px 1px 1px); /* IE7 */
     125        clip: rect(1px, 1px, 1px, 1px);
     126        }
    126127        <?php
    127                         if ( empty( $header_image ) ) :
     128        if ( empty( $header_image ) ) :
    128129        ?>
    129                 .site-header .home-link {
    130                         min-height: 0;
    131                 }
     130.site-header .home-link {
     131        min-height: 0;
     132}
    132133        <?php
    133                         endif;
     134        endif;
    134135
    135                 // If the user has set a custom color for the text, use that.
     136        // If the user has set a custom color for the text, use that.
    136137                elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) :
    137138        ?>
    138139                .site-title,
  • src/wp-content/themes/twentythirteen/page.php

     
    3232
    3333                                        <div class="entry-content">
    3434                                                <?php the_content(); ?>
    35                                                 <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
     35                                                <?php wp_link_pages( array(
     36                                                        'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>',
     37                                                        'after' => '</div>',
     38                                                        'link_before' => '<span>',
     39                                                        'link_after' => '</span>',
     40                                                ) ); ?>
    3641                                        </div><!-- .entry-content -->
    3742
    3843                                        <footer class="entry-meta">
     
    4752        </div><!-- #primary -->
    4853
    4954<?php get_sidebar(); ?>
    50 <?php get_footer(); ?>
    51  No newline at end of file
     55<?php get_footer(); ?>
  • src/wp-content/themes/twentythirteen/search.php

     
    3333        </div><!-- #primary -->
    3434
    3535<?php get_sidebar(); ?>
    36 <?php get_footer(); ?>
    37  No newline at end of file
     36<?php get_footer(); ?>
  • src/wp-content/themes/twentythirteen/sidebar-main.php

     
    1515                        <?php dynamic_sidebar( 'sidebar-1' ); ?>
    1616                </div><!-- .widget-area -->
    1717        </div><!-- #secondary -->
    18 <?php endif; ?>
    19  No newline at end of file
     18<?php endif; ?>
  • src/wp-content/themes/twentythirteen/sidebar.php

     
    1919                        </div><!-- .widget-area -->
    2020                </div><!-- .sidebar-inner -->
    2121        </div><!-- #tertiary -->
    22 <?php endif; ?>
    23  No newline at end of file
     22<?php endif; ?>
  • src/wp-content/themes/twentythirteen/single.php

     
    2525        </div><!-- #primary -->
    2626
    2727<?php get_sidebar(); ?>
    28 <?php get_footer(); ?>
    29  No newline at end of file
     28<?php get_footer(); ?>
  • src/wp-content/themes/twentytwelve/404.php

     
    2626                </div><!-- #content -->
    2727        </div><!-- #primary -->
    2828
    29 <?php get_footer(); ?>
    30  No newline at end of file
     29<?php get_footer(); ?>
  • src/wp-content/themes/twentytwelve/archive.php

     
    2525                <?php if ( have_posts() ) : ?>
    2626                        <header class="archive-header">
    2727                                <h1 class="archive-title"><?php
    28                                         if ( is_day() ) :
    29                                                 printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
     28                                if ( is_day() ) :
     29                                        printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
    3030                                        elseif ( is_month() ) :
    3131                                                printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
    3232                                        elseif ( is_year() ) :
  • src/wp-content/themes/twentytwelve/comments.php

     
    1717 * the visitor has not yet entered the password we will
    1818 * return early without loading the comments.
    1919 */
    20 if ( post_password_required() )
     20if ( post_password_required() ) {
    2121        return;
     22}
    2223?>
    2324
    2425<div id="comments" class="comments-area">
     
    2930                <h2 class="comments-title">
    3031                        <?php
    3132                                printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ),
    32                                         number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
     33                                number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
    3334                        ?>
    3435                </h2>
    3536
    3637                <ol class="commentlist">
    37                         <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
     38                        <?php wp_list_comments( array(
     39                                'callback' => 'twentytwelve_comment',
     40                                'style' => 'ol',
     41                        ) ); ?>
    3842                </ol><!-- .commentlist -->
    3943
    4044                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
     
    5761
    5862        <?php comment_form(); ?>
    5963
    60 </div><!-- #comments .comments-area -->
    61  No newline at end of file
     64</div><!-- #comments .comments-area -->
  • src/wp-content/themes/twentytwelve/footer.php

     
    2020
    2121<?php wp_footer(); ?>
    2222</body>
    23 </html>
    24  No newline at end of file
     23</html>
  • src/wp-content/themes/twentytwelve/functions.php

     
    2323 */
    2424
    2525// Set up the content width value based on the theme's design and stylesheet.
    26 if ( ! isset( $content_width ) )
     26if ( ! isset( $content_width ) ) {
    2727        $content_width = 625;
     28}
    2829
    2930/**
    3031 * Twenty Twelve setup.
     
    109110                 */
    110111                $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
    111112
    112                 if ( 'cyrillic' == $subset )
     113                if ( 'cyrillic' == $subset ) {
    113114                        $subsets .= ',cyrillic,cyrillic-ext';
    114                 elseif ( 'greek' == $subset )
     115                } elseif ( 'greek' == $subset ) {
    115116                        $subsets .= ',greek,greek-ext';
    116                 elseif ( 'vietnamese' == $subset )
     117                } elseif ( 'vietnamese' == $subset ) {
    117118                        $subsets .= ',vietnamese';
     119                }
    118120
    119121                $query_args = array(
    120122                        'family' => 'Open+Sans:400italic,700italic,400,700',
     
    138140         * Adds JavaScript to pages with the comment form to support
    139141         * sites with threaded comments (when in use).
    140142         */
    141         if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
     143        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
    142144                wp_enqueue_script( 'comment-reply' );
     145        }
    143146
    144147        // Adds JavaScript for handling the navigation menu hide-and-show behavior.
    145148        wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
    146149
    147150        $font_url = twentytwelve_get_font_url();
    148         if ( ! empty( $font_url ) )
     151        if ( ! empty( $font_url ) ) {
    149152                wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
     153        }
    150154
    151155        // Loads our main stylesheet.
    152156        wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
     
    197201function twentytwelve_mce_css( $mce_css ) {
    198202        $font_url = twentytwelve_get_font_url();
    199203
    200         if ( empty( $font_url ) )
     204        if ( empty( $font_url ) ) {
    201205                return $mce_css;
     206        }
    202207
    203         if ( ! empty( $mce_css ) )
     208        if ( ! empty( $mce_css ) ) {
    204209                $mce_css .= ',';
     210        }
    205211
    206212        $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) );
    207213
     
    224230function twentytwelve_wp_title( $title, $sep ) {
    225231        global $paged, $page;
    226232
    227         if ( is_feed() )
     233        if ( is_feed() ) {
    228234                return $title;
     235        }
    229236
    230237        // Add the site name.
    231238        $title .= get_bloginfo( 'name', 'display' );
    232239
    233240        // Add the site description for the home/front page.
    234241        $site_description = get_bloginfo( 'description', 'display' );
    235         if ( $site_description && ( is_home() || is_front_page() ) )
     242        if ( $site_description && ( is_home() || is_front_page() ) ) {
    236243                $title = "$title $sep $site_description";
     244        }
    237245
    238246        // Add a page number if necessary.
    239         if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
     247        if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
    240248                $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
     249        }
    241250
    242251        return $title;
    243252}
     
    251260 * @since Twenty Twelve 1.0
    252261 */
    253262function twentytwelve_page_menu_args( $args ) {
    254         if ( ! isset( $args['show_home'] ) )
     263        if ( ! isset( $args['show_home'] ) ) {
    255264                $args['show_home'] = true;
     265        }
    256266        return $args;
    257267}
    258268add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
     
    298308add_action( 'widgets_init', 'twentytwelve_widgets_init' );
    299309
    300310if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
    301 /**
     311        /**
    302312 * Displays navigation to next/previous pages when applicable.
    303313 *
    304314 * @since Twenty Twelve 1.0
    305315 */
    306 function twentytwelve_content_nav( $html_id ) {
    307         global $wp_query;
     316        function twentytwelve_content_nav( $html_id ) {
     317                global $wp_query;
    308318
    309         if ( $wp_query->max_num_pages > 1 ) : ?>
    310                 <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation">
    311                         <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
    312                         <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
    313                         <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
    314                 </nav><!-- .navigation -->
    315         <?php endif;
    316 }
     319                if ( $wp_query->max_num_pages > 1 ) : ?>
     320                        <nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation">
     321                                <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
     322                                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
     323                                <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
     324                        </nav><!-- .navigation -->
     325                <?php endif;
     326        }
    317327endif;
    318328
    319329if ( ! function_exists( 'twentytwelve_comment' ) ) :
    320 /**
     330        /**
    321331 * Template for comments and pingbacks.
    322332 *
    323333 * To override this walker in a child theme without modifying the comments template
     
    327337 *
    328338 * @since Twenty Twelve 1.0
    329339 */
    330 function twentytwelve_comment( $comment, $args, $depth ) {
    331         $GLOBALS['comment'] = $comment;
    332         switch ( $comment->comment_type ) :
    333                 case 'pingback' :
    334                 case 'trackback' :
    335                 // Display trackbacks differently than normal comments.
    336         ?>
    337         <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
     340        function twentytwelve_comment( $comment, $args, $depth ) {
     341                $GLOBALS['comment'] = $comment;
     342                switch ( $comment->comment_type ) :
     343                        case 'pingback' :
     344                        case 'trackback' :
     345                                // Display trackbacks differently than normal comments.
     346                ?>
     347                <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
    338348                <p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
    339349        <?php
    340350                        break;
    341                 default :
    342                 // Proceed with normal comments.
    343                 global $post;
    344         ?>
    345         <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
     351                        default :
     352                                // Proceed with normal comments.
     353                                global $post;
     354                ?>
     355                <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    346356                <article id="comment-<?php comment_ID(); ?>" class="comment">
    347357                        <header class="comment-meta comment-author vcard">
    348358                                <?php
     
    358368                                                /* translators: 1: date, 2: time */
    359369                                                sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
    360370                                        );
    361                                 ?>
    362                         </header><!-- .comment-meta -->
     371                                        ?>
     372                                </header><!-- .comment-meta -->
    363373
    364                         <?php if ( '0' == $comment->comment_approved ) : ?>
     374                                <?php if ( '0' == $comment->comment_approved ) : ?>
    365375                                <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
    366376                        <?php endif; ?>
    367377
    368                         <section class="comment-content comment">
     378                                <section class="comment-content comment">
    369379                                <?php comment_text(); ?>
    370380                                <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?>
    371                         </section><!-- .comment-content -->
     381                                </section><!-- .comment-content -->
    372382
    373                         <div class="reply">
    374                                 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    375                         </div><!-- .reply -->
    376                 </article><!-- #comment-## -->
    377         <?php
     383                                <div class="reply">
     384                                <?php comment_reply_link( array_merge( $args, array(
     385                                        'reply_text' => __( 'Reply', 'twentytwelve' ),
     386                                        'after' => ' <span>&darr;</span>',
     387                                        'depth' => $depth,
     388                                        'max_depth' => $args['max_depth'],
     389                                ) ) ); ?>
     390                                </div><!-- .reply -->
     391                        </article><!-- #comment-## -->
     392                <?php
    378393                break;
    379         endswitch; // end comment_type check
    380 }
     394                        endswitch; // end comment_type check
     395        }
    381396endif;
    382397
    383398if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
    384 /**
     399        /**
    385400 * Set up post entry meta.
    386401 *
    387402 * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
     
    390405 *
    391406 * @since Twenty Twelve 1.0
    392407 */
    393 function twentytwelve_entry_meta() {
    394         // Translators: used between list items, there is a space after the comma.
    395         $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
    396 
    397         // Translators: used between list items, there is a space after the comma.
    398         $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
    399 
    400         $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
    401                 esc_url( get_permalink() ),
    402                 esc_attr( get_the_time() ),
    403                 esc_attr( get_the_date( 'c' ) ),
    404                 esc_html( get_the_date() )
    405         );
    406 
    407         $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
    408                 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    409                 esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
    410                 get_the_author()
    411         );
    412 
    413         // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
    414         if ( $tag_list ) {
    415                 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
    416         } elseif ( $categories_list ) {
    417                 $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
    418         } else {
    419                 $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
    420         }
    421 
    422         printf(
    423                 $utility_text,
    424                 $categories_list,
    425                 $tag_list,
    426                 $date,
    427                 $author
    428         );
    429 }
     408        function twentytwelve_entry_meta() {
     409                // Translators: used between list items, there is a space after the comma.
     410                $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
     411
     412                // Translators: used between list items, there is a space after the comma.
     413                $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
     414
     415                $date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
     416                        esc_url( get_permalink() ),
     417                        esc_attr( get_the_time() ),
     418                        esc_attr( get_the_date( 'c' ) ),
     419                        esc_html( get_the_date() )
     420                );
     421
     422                        $author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
     423                                esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
     424                                esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
     425                                get_the_author()
     426                        );
     427
     428                        // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
     429                if ( $tag_list ) {
     430                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
     431                } elseif ( $categories_list ) {
     432                        $utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
     433                } else {
     434                        $utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
     435                }
     436
     437                        printf(
     438                                $utility_text,
     439                                $categories_list,
     440                                $tag_list,
     441                                $date,
     442                                $author
     443                        );
     444        }
    430445endif;
    431446
    432447/**
     
    450465        $background_color = get_background_color();
    451466        $background_image = get_background_image();
    452467
    453         if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
     468        if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) {
    454469                $classes[] = 'full-width';
     470        }
    455471
    456472        if ( is_page_template( 'page-templates/front-page.php' ) ) {
    457473                $classes[] = 'template-front-page';
    458                 if ( has_post_thumbnail() )
     474                if ( has_post_thumbnail() ) {
    459475                        $classes[] = 'has-post-thumbnail';
    460                 if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
     476                }
     477                if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) {
    461478                        $classes[] = 'two-sidebars';
     479                }
    462480        }
    463481
    464482        if ( empty( $background_image ) ) {
    465                 if ( empty( $background_color ) )
     483                if ( empty( $background_color ) ) {
    466484                        $classes[] = 'custom-background-empty';
    467                 elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
     485                } elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) {
    468486                        $classes[] = 'custom-background-white';
     487                }
    469488        }
    470489
    471490        // Enable custom font class only if the font CSS is queued to load.
    472         if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
     491        if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) {
    473492                $classes[] = 'custom-font-enabled';
     493        }
    474494
    475         if ( ! is_multi_author() )
     495        if ( ! is_multi_author() ) {
    476496                $classes[] = 'single-author';
     497        }
    477498
    478499        return $classes;
    479500}
  • src/wp-content/themes/twentytwelve/header.php

     
    5050                <?php endif; ?>
    5151        </header><!-- #masthead -->
    5252
    53         <div id="main" class="wrapper">
    54  No newline at end of file
     53        <div id="main" class="wrapper">
  • src/wp-content/themes/twentytwelve/image.php

     
    5454 */
    5555$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' ) ) );
    5656foreach ( $attachments as $k => $attachment ) :
    57         if ( $attachment->ID == $post->ID )
     57        if ( $attachment->ID == $post->ID ) {
    5858                break;
     59        }
    5960endforeach;
    6061
    6162// If there is more than 1 attachment in a gallery
     
    7576?>
    7677                                                                <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
    7778                                                                /**
    78                                                                 * Filter the image attachment size to use.
     79                                                                  * Filter the image attachment size to use.
    7980                                                                 *
    8081                                                                 * @since Twenty Twelve 1.0
    8182                                                                 *
  • src/wp-content/themes/twentytwelve/inc/custom-header.php

     
    5454 */
    5555function twentytwelve_custom_header_fonts() {
    5656        $font_url = twentytwelve_get_font_url();
    57         if ( ! empty( $font_url ) )
     57        if ( ! empty( $font_url ) ) {
    5858                wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
     59        }
    5960}
    6061add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' );
    6162
     
    7071        $text_color = get_header_textcolor();
    7172
    7273        // If no custom options for text are set, let's bail
    73         if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
     74        if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
    7475                return;
     76        }
    7577
    7678        // If we get this far, we have custom styles.
    7779        ?>
    7880        <style type="text/css" id="twentytwelve-header-css">
    7981        <?php
    8082                // Has the text been hidden?
    81                 if ( ! display_header_text() ) :
     83        if ( ! display_header_text() ) :
    8284        ?>
    83                 .site-title,
    84                 .site-description {
    85                         position: absolute;
    86                         clip: rect(1px 1px 1px 1px); /* IE7 */
    87                         clip: rect(1px, 1px, 1px, 1px);
    88                 }
     85        .site-title,
     86        .site-description {
     87        position: absolute;
     88        clip: rect(1px 1px 1px 1px); /* IE7 */
     89        clip: rect(1px, 1px, 1px, 1px);
     90        }
    8991        <?php
    90                 // If the user has set a custom color for the text, use that.
     92        // If the user has set a custom color for the text, use that.
    9193                else :
    9294        ?>
    9395                .site-header h1 a,
  • src/wp-content/themes/twentytwelve/page-templates/front-page.php

     
    3232        </div><!-- #primary -->
    3333
    3434<?php get_sidebar( 'front' ); ?>
    35 <?php get_footer(); ?>
    36  No newline at end of file
     35<?php get_footer(); ?>
  • src/wp-content/themes/twentytwelve/page-templates/full-width.php

     
    2727                </div><!-- #content -->
    2828        </div><!-- #primary -->
    2929
    30 <?php get_footer(); ?>
    31  No newline at end of file
     30<?php get_footer(); ?>
  • src/wp-content/themes/twentytwelve/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/twentytwelve/search.php

     
    4646        </section><!-- #primary -->
    4747
    4848<?php get_sidebar(); ?>
    49 <?php get_footer(); ?>
    50  No newline at end of file
     49<?php get_footer(); ?>
  • src/wp-content/themes/twentytwelve/sidebar-front.php

     
    1515 *
    1616 * If none of the sidebars have widgets, then let's bail early.
    1717 */
    18 if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
     18if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) {
    1919        return;
     20}
    2021
    2122// If we get this far, we have widgets. Let do this.
    2223?>
     
    3233                <?php dynamic_sidebar( 'sidebar-3' ); ?>
    3334        </div><!-- .second -->
    3435        <?php endif; ?>
    35 </div><!-- #secondary -->
    36  No newline at end of file
     36</div><!-- #secondary -->
  • src/wp-content/themes/twentytwelve/sidebar.php

     
    1414                <div id="secondary" class="widget-area" role="complementary">
    1515                        <?php dynamic_sidebar( 'sidebar-1' ); ?>
    1616                </div><!-- #secondary -->
    17         <?php endif; ?>
    18  No newline at end of file
     17        <?php endif; ?>
  • src/wp-content/themes/twentytwelve/single.php

     
    3030        </div><!-- #primary -->
    3131
    3232<?php get_sidebar(); ?>
    33 <?php get_footer(); ?>
    34  No newline at end of file
     33<?php get_footer(); ?>