Make WordPress Core

Changeset 25021


Ignore:
Timestamp:
08/14/2013 04:38:01 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: first pass at matching code standards achieved with Twenty Thirteen development. See #24858, props obenland.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
1 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/404.php

    r24832 r25021  
    1212        <div id="content" class="site-content" role="main">
    1313
    14             <article id="post-0" class="post error404 not-found">
    15                 <header class="entry-header">
    16                     <h1 class="entry-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentyfourteen' ); ?></h1>
    17                 </header><!-- .entry-header -->
     14            <header class="page-header">
     15                <h1 class="page-title"><?php _e( "Oops! That page can't be found.", 'twentyfourteen' ); ?></h1>
     16            </header>
    1817
    19                 <div class="entry-content">
    20                     <p><?php _e( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'twentyfourteen' ); ?></p>
     18            <div class="page-content">
     19                <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfourteen' ); ?></p>
    2120
    22                     <?php get_search_form(); ?>
     21                <?php get_search_form(); ?>
     22            </div><!-- .page-content -->
    2323
    24                 </div><!-- .entry-content -->
    25             </article><!-- #post-0 .post .error404 .not-found -->
     24        </div><!-- #content -->
     25    </div><!-- #primary -->
    2626
    27         </div><!-- #content .site-content -->
    28     </div><!-- #primary .content-area -->
    29 
    30 <?php get_sidebar( 'content' ); ?>
    31 
    32 <?php get_sidebar(); ?>
    33 
    34 <?php get_footer(); ?>
     27<?php
     28get_sidebar( 'content' );
     29get_sidebar();
     30get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/archive.php

    r24832 r25021  
    22/**
    33 * The template for displaying Archive pages.
     4 *
     5 * Used to display archive-type pages if nothing more specific matches a query.
     6 * For example, puts together date-based pages if no date.php file exists.
     7 *
     8 * If you'd like to further customize these archive views, you may create a
     9 * new template file for each specific one. For example, Twenty Fourteen
     10 * already has tag.php for Tag archives, category.php for Category archives,
     11 * and author.php for Author archives.
    412 *
    513 * Learn more: http://codex.wordpress.org/Template_Hierarchy
     
    1422    <div id="content" class="site-content" role="main">
    1523
    16     <?php if ( have_posts() ) : ?>
     24        <?php if ( have_posts() ) : ?>
    1725
    1826        <header class="page-header">
    1927            <h1 class="page-title">
    2028                <?php
    21                     if ( is_category() ) {
    22                         printf( __( 'Category Archives: %s', 'twentyfourteen' ), '<span>' . single_cat_title( '', false ) . '</span>' );
     29                    if ( is_day() ) :
     30                        printf( __( 'Day: %s', 'twentyfourteen' ), get_the_date() );
    2331
    24                     } elseif ( is_tag() ) {
    25                         printf( __( 'Tag Archives: %s', 'twentyfourteen' ), '<span>' . single_tag_title( '', false ) . '</span>' );
     32                    elseif ( is_month() ) :
     33                        printf( __( 'Month: %s', 'twentyfourteen' ), get_the_date( 'F Y' ) );
    2634
    27                     } elseif ( is_author() ) {
    28                         /* Queue the first post, that way we know
    29                          * what author we're dealing with (if that is the case).
    30                         */
    31                         the_post();
    32                         printf( __( 'Author Archives: %s', 'twentyfourteen' ), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' );
    33                         /* Since we called the_post() above, we need to
    34                          * rewind the loop back to the beginning that way
    35                          * we can run the loop properly, in full.
    36                          */
    37                         rewind_posts();
     35                    elseif ( is_year() ) :
     36                        printf( __( 'Year: %s', 'twentyfourteen' ), get_the_date( 'Y' ) );
    3837
    39                     } elseif ( is_day() ) {
    40                         printf( __( 'Daily Archives: %s', 'twentyfourteen' ), '<span>' . get_the_date() . '</span>' );
    41 
    42                     } elseif ( is_month() ) {
    43                         printf( __( 'Monthly Archives: %s', 'twentyfourteen' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
    44 
    45                     } elseif ( is_year() ) {
    46                         printf( __( 'Yearly Archives: %s', 'twentyfourteen' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
    47 
    48                     } else {
     38                    else :
    4939                        _e( 'Archives', 'twentyfourteen' );
    5040
    51                     }
     41                    endif;
    5242                ?>
    5343            </h1>
    54             <?php
    55                 if ( is_category() ) {
    56                     // show an optional category description
    57                     $category_description = category_description();
    58                     if ( ! empty( $category_description ) )
    59                         echo apply_filters( 'category_archive_meta', '<div class="taxonomy-description">' . $category_description . '</div>' );
    60 
    61                 } elseif ( is_tag() ) {
    62                     // show an optional tag description
    63                     $tag_description = tag_description();
    64                     if ( ! empty( $tag_description ) )
    65                         echo apply_filters( 'tag_archive_meta', '<div class="taxonomy-description">' . $tag_description . '</div>' );
    66                 }
    67             ?>
    6844        </header><!-- .page-header -->
    6945
    70         <?php while ( have_posts() ) : the_post(); ?>
     46        <?php
     47                while ( have_posts() ) :
     48                    the_post();
    7149
    72             <?php twentyfourteen_get_template_part(); ?>
     50                    twentyfourteen_get_template_part();
     51                endwhile;
     52                twentyfourteen_content_nav( 'nav-below' );
    7353
    74         <?php endwhile; ?>
     54            else :
     55                get_template_part( 'no-results', 'archive' );
    7556
    76         <?php twentyfourteen_content_nav( 'nav-below' ); ?>
     57            endif;
     58        ?>
     59    </div><!-- #content -->
     60</section><!-- #primary -->
    7761
    78     <?php else : ?>
    79 
    80         <?php get_template_part( 'no-results', 'archive' ); ?>
    81 
    82     <?php endif; ?>
    83 
    84     </div><!-- #content .site-content -->
    85 </section><!-- #primary .content-area -->
    86 
    87 <?php get_sidebar( 'content' ); ?>
    88 
    89 <?php get_sidebar(); ?>
    90 
    91 <?php get_footer(); ?>
     62<?php
     63get_sidebar( 'content' );
     64get_sidebar();
     65get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/comments.php

    r24832 r25021  
    33 * The template for displaying Comments.
    44 *
    5  * The area of the page that contains both current comments
    6  * and the comment form. The actual display of comments is
    7  * handled by a callback to twentyfourteen_comment() which is
    8  * located in the functions.php file.
     5 * The area of the page that contains comments and the comment form.
    96 *
    107 * @package WordPress
    118 * @subpackage Twenty_Fourteen
    129 */
     10
     11/*
     12 * If the current post is protected by a password and the visitor has not yet
     13 * entered the password we will return early without loading the comments.
     14 */
     15if ( post_password_required() )
     16    return;
    1317?>
    1418
    15 <?php
    16     /*
    17      * If the current post is protected by a password and
    18      * the visitor has not yet entered the password we will
    19      * return early without loading the comments.
    20      */
    21     if ( post_password_required() )
    22         return;
    23 ?>
    24 
    25     <div id="comments" class="comments-area">
    26 
    27     <?php // You can start editing here -- including this comment! ?>
     19<div id="comments" class="comments-area">
    2820
    2921    <?php if ( have_comments() ) : ?>
    30         <h2 class="comments-title">
    31             <?php
    32                 printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyfourteen' ),
    33                     number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
    34             ?>
    35         </h2>
    3622
    37         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
    38         <nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation clearfix">
    39             <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
    40             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
    41             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
    42         </nav><!-- #comment-nav-above .site-navigation .comment-navigation -->
    43         <?php endif; // check for comment navigation ?>
     23    <h2 class="comments-title">
     24        <?php
     25            printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyfourteen' ),
     26                number_format_i18n( get_comments_number() ), get_the_title() );
     27        ?>
     28    </h2>
    4429
    45         <ol class="commentlist">
    46             <?php
    47                 /* Loop through and list the comments. Tell wp_list_comments()
    48                  * to use twentyfourteen_comment() to format the comments.
    49                  * If you want to overload this in a child theme then you can
    50                  * define twentyfourteen_comment() and that will be used instead.
    51                  * See twentyfourteen_comment() in inc/template-tags.php for more.
    52                  */
    53                 wp_list_comments( array( 'callback' => 'twentyfourteen_comment' ) );
    54             ?>
    55         </ol><!-- .commentlist -->
     30    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
     31    <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
     32        <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
     33        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
     34        <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
     35    </nav><!-- #comment-nav-above -->
     36    <?php endif; // Check for comment navigation. ?>
    5637
    57         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
    58         <nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation clearfix">
    59             <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
    60             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
    61             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
    62         </nav><!-- #comment-nav-below .site-navigation .comment-navigation -->
    63         <?php endif; // check for comment navigation ?>
     38    <ol class="comment-list">
     39        <?php
     40            wp_list_comments( array(
     41                'style'      => 'ol',
     42                'short_ping' => true,
     43
     44                // TODO: Remove callback and update styles.
     45                'callback'=>'twentyfourteen_comment',
     46            ) );
     47        ?>
     48    </ol><!-- .comment-list -->
     49
     50    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
     51    <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
     52        <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
     53        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyfourteen' ) ); ?></div>
     54        <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyfourteen' ) ); ?></div>
     55    </nav><!-- #comment-nav-below -->
     56    <?php endif; // Check for comment navigation. ?>
     57
     58    <?php if ( ! comments_open() ) : ?>
     59    <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p>
     60    <?php endif; ?>
    6461
    6562    <?php endif; // have_comments() ?>
    6663
    67     <?php
    68         // If comments are closed and there are comments, let's leave a little note, shall we?
    69         if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    70     ?>
    71         <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p>
    72     <?php endif; ?>
    73 
    7464    <?php comment_form(); ?>
    7565
    76 </div><!-- #comments .comments-area -->
     66</div><!-- #comments -->
  • trunk/src/wp-content/themes/twentyfourteen/content-featured-post.php

    r24832 r25021  
    66?>
    77
    8 <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
    9     <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-featured">
     8<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     9    <a class="attachment-featured-featured" href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>">
    1010        <?php
    11             $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 1 ) );
     11            if ( has_post_thumbnail() ) :
     12                the_post_thumbnail( 'featured-thumbnail-featured' );
    1213
    13             if ( '' != get_the_post_thumbnail() ) :
    14                 the_post_thumbnail( 'featured-thumbnail-featured' );
    15             elseif ( $images ) :
    16                 $image = array_shift( $images );
    17                 echo wp_get_attachment_image( $image->ID, 'featured-thumbnail-featured' );
    18             else : ?>
    19                 <img src="<?php echo get_template_directory_uri(); ?>/images/placeholder.png" alt="" class="featured-thumbnail-featured" /><?php
     14            else :
     15                $images = get_children( array(
     16                    'post_parent'    => get_the_ID(),
     17                    'post_type'      => 'attachment',
     18                    'post_mime_type' => 'image',
     19                    'orderby'        => 'menu_order',
     20                    'order'          => 'ASC',
     21                    'numberposts'    => 1,
     22                ) );
     23
     24                if ( $images ) :
     25                    $image = array_shift( $images );
     26                    echo wp_get_attachment_image( $image->ID, 'featured-thumbnail-featured' );
     27
     28                else : ?>
     29                    <img class="featured-thumbnail-featured" src="<?php echo get_template_directory_uri(); ?>/images/placeholder.png" alt="" /><?php
     30
     31                endif;
    2032            endif;
    2133        ?>
     
    2436    <div class="entry-wrap">
    2537        <header class="entry-header">
     38            <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    2639            <div class="entry-meta">
    27                 <?php
    28                     /* translators: used between list items, there is a space after the comma */
    29                     $categories_list = get_the_category_list( __( ', ', 'twentyfourteen' ) );
    30                     if ( $categories_list && twentyfourteen_categorized_blog() ) :
    31                 ?>
    32                 <span class="cat-links">
    33                     <?php echo $categories_list; ?>
    34                 </span>
    35                 <?php endif; // End if categories ?>
     40                <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
    3641            </div><!-- .entry-meta -->
    37             <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
     42            <?php endif; ?>
     43
     44            <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    3845        </header><!-- .entry-header -->
    3946
    40         <div class="entry-summary clearfix">
     47        <div class="entry-summary">
    4148            <?php the_excerpt(); ?>
    4249        </div><!-- .entry-summary -->
    4350    </div>
    44 
    45 </article><!-- #post-<?php the_ID(); ?> -->
     51</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/content-page.php

    r24832 r25021  
    11<?php
    22/**
    3  * The template used for displaying page content in page.php
     3 * The template used for displaying page content.
    44 *
    55 * @package WordPress
     
    99
    1010<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    11     <header class="entry-header">
    12         <h1 class="entry-title"><?php the_title(); ?></h1>
    13     </header><!-- .entry-header -->
     11    <?php the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' ); ?>
    1412
    15     <div class="entry-content clearfix">
    16         <?php the_content(); ?>
     13    <div class="entry-content">
    1714        <?php
     15            the_content();
    1816            wp_link_pages( array(
    1917                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    2018                'after'       => '</div>',
    2119                'link_before' => '<span>',
    22                 'link_after'  => '</span>'
     20                'link_after'  => '</span>',
    2321            ) );
     22
     23            edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
    2424        ?>
    25         <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
    2625    </div><!-- .entry-content -->
    27 </article><!-- #post-<?php the_ID(); ?> -->
     26</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/content-post-format.php

    r24989 r25021  
    4444                if ( 'post' == get_post_type() )
    4545                    twentyfourteen_posted_on();
     46
     47                if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) :
    4648            ?>
    47 
    48             <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
    49                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
     49            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    5050            <?php endif; ?>
    5151
     
    5454    </header><!-- .entry-header -->
    5555
    56     <div class="entry-content clearfix">
    57         <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); ?>
     56    <div class="entry-content">
    5857        <?php
     58            the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
    5959            wp_link_pages( array(
    6060                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    6161                'after'       => '</div>',
    6262                'link_before' => '<span>',
    63                 'link_after'  => '</span>'
     63                'link_after'  => '</span>',
    6464            ) );
    6565        ?>
     
    6767
    6868    <footer class="entry-meta">
    69         <?php if ( ( 'quote' == $format ) || ( 'aside' == $format ) ) : ?>
     69        <?php if ( has_post_format( array( 'quote', 'aside' ) ) ) : ?>
    7070        <div class="entry-meta">
    71             <?php the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h1>' ); ?>
     71            <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    7272        </div>
    7373        <?php endif; ?>
    7474
    75         <?php
    76             $tag_list = get_the_tag_list();
    77             if ( '' != $tag_list && 'post' == get_post_type() ) :
    78         ?>
    79         <span class="tag-links"><?php echo $tag_list; ?></span>
    80         <?php endif; // End if $tag_list ?>
     75        <?php if ( has_tag() ) : ?>
     76        <span class="tag-links"><?php echo get_the_tag_list(); ?></span>
     77        <?php endif; ?>
    8178    </footer><!-- .entry-meta -->
    82 
    83 </article><!-- #post-<?php the_ID(); ?> -->
     79</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/content-recent-formatted-post.php

    r24832 r25021  
    77    $GLOBALS['content_width'] = 306;
    88
    9 $format = get_post_format();
    10 if ( false === $format )
    11     $format = 'standard';
     9$images = get_posts( array(
     10    'post_parent'    => get_post()->post_parent,
     11    'fields'         => 'ids',
     12    'numberposts'    => -1,
     13    'post_status'    => 'inherit',
     14    'post_type'      => 'attachment',
     15    'post_mime_type' => 'image',
     16    'order'          => 'ASC',
     17    'orderby'        => 'menu_order ID'
     18) );
     19$total_images = count( $images );
    1220?>
    1321
    14 <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
    15     <div class="entry-content clearfix">
     22<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     23    <div class="entry-content">
    1624        <?php
    17             if ( 'gallery' == $format ) :
    18                 $featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );
    19                 $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
    20                 if ( $images ) :
    21                     $total_images = count( $images );
    22                     if ( empty( $featured_image ) ) {
    23                         $image = array_shift( $images );
    24                         $featured_image = wp_get_attachment_image( $image->ID, 'featured-thumbnail-formatted' );
    25                     }
     25            if ( has_post_format( 'gallery' ) ) :
     26                if ( has_post_thumbnail() ) :
     27                    $featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );
     28                elseif ( $total_images > 0 ) :
     29                    $image = array_shift( $images );
     30                    $featured_image = wp_get_attachment_image( $image, 'featured-thumbnail-formatted' );
    2631        ?>
    27                     <a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
    28                     <p class="wp-caption-text"><?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, 'twentyfourteen' ),
    29                     'href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
     32        <a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
     33        <p class="wp-caption-text">
     34            <?php
     35                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' ),
     36                    esc_url( get_permalink() ),
    3037                    number_format_i18n( $total_images )
    31                 ); ?></p><?php
     38                );
     39            ?>
     40        </p>
     41        <?php
    3242                else :
    3343                    the_excerpt();
     
    4252        <div class="entry-meta">
    4353            <?php
    44                 if ( 'link' != $format ) :
    45                     the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark">', '</a></h1>' );
     54                if ( ! has_post_format( 'link' ) ) :
     55                    the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    4656                endif;
     57
     58                twentyfourteen_posted_on();
     59
     60                if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
    4761            ?>
    48             <?php twentyfourteen_posted_on(); ?>
    49             <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
    5062            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    5163            <?php endif; ?>
    5264        </div><!-- .entry-meta -->
    5365    </header><!-- .entry-header -->
    54 </article>
     66</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/content-single.php

    r24832 r25021  
    44 * @subpackage Twenty_Fourteen
    55 */
    6 $format = get_post_format();
    7 if ( false === $format )
    8     $format = 'standard';
     6has_post_format()
    97?>
    108
    119<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    12     <?php if ( ( 'video' != $format ) && ( 'image' != $format ) && ( 'aside' != $format ) && ( 'link' != $format ) && ( 'quote' != $format ) ) : ?>
     10    <?php if ( has_post_thumbnail() && ! has_post_format( array( 'video', 'image', 'aside', 'link', 'quote' ) ) ) : ?>
    1311    <div class="attachment-featured-thumbnail">
    14     <?php
    15         if ( '' != get_the_post_thumbnail() )
    16             the_post_thumbnail( 'featured-thumbnail-large' );
    17     ?>
     12    <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
    1813    </div>
    1914    <?php endif; ?>
    2015
    2116    <header class="entry-header">
     17        <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    2218        <div class="entry-meta">
    23             <?php
    24                 /* translators: used between list items, there is a space after the comma */
    25                 $categories_list = get_the_category_list( __( ', ', 'twentyfourteen' ) );
    26                 if ( $categories_list && twentyfourteen_categorized_blog() ) :
    27             ?>
    28             <span class="cat-links">
    29                 <?php echo $categories_list; ?>
    30             </span>
    31             <?php endif; // End if categories ?>
     19            <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
    3220        </div><!-- .entry-meta -->
     21        <?php
     22            endif;
    3323
    34         <?php if ( ( 'standard' == $format ) || ( 'video' == $format ) || ( 'image' == $format ) || ( 'gallery' == $format ) ) : ?>
    35             <h1 class="entry-title"><?php the_title(); ?></h1>
    36         <?php endif; ?>
     24            if ( ! has_post_format( array( 'status', 'chat', 'aside', 'link', 'quote', 'audio' ) ) ) :
     25                the_title( '<h1 class="entry-title">', '</h1>' );
     26            endif;
     27        ?>
    3728
    3829        <div class="entry-meta">
    39             <?php if ( 'standard' != $format ) : ?>
     30            <?php if ( has_post_format() ) : ?>
    4031            <span class="post-format">
    4132                <a class="entry-format" href="<?php echo esc_url( get_post_format_link( get_post_format() ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( get_post_format() ) ) ); ?>"><?php echo get_post_format_string( get_post_format() ); ?></a>
     
    4536            <?php twentyfourteen_posted_on(); ?>
    4637
    47             <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
     38            <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : ?>
    4839            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    4940            <?php endif; ?>
     
    5344    </header><!-- .entry-header -->
    5445
    55     <div class="entry-content clearfix">
    56         <?php the_content(); ?>
     46    <div class="entry-content">
    5747        <?php
     48            the_content();
    5849            wp_link_pages( array(
    5950                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    6051                'after'       => '</div>',
    6152                'link_before' => '<span>',
    62                 'link_after'  => '</span>'
     53                'link_after'  => '</span>',
    6354            ) );
    6455        ?>
     
    6657
    6758    <footer class="entry-meta">
    68         <?php if ( ( 'quote' == $format ) || ( 'aside' == $format ) ) : ?>
     59        <?php if ( has_post_format( array( 'quote', 'aside' ) ) ) : ?>
    6960        <div class="entry-meta">
    70             <?php the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h1>' ); ?>
     61            <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    7162        </div><!-- .entry-meta -->
    7263        <?php endif; ?>
    7364
    74         <?php
    75             $tag_list = get_the_tag_list();
    76             if ( '' != $tag_list ) :
    77         ?>
     65        <?php if ( has_tag() ) : ?>
    7866            <span class="tag-links">
    79                 <?php echo $tag_list; ?>
     67                <?php echo get_the_tag_list(); ?>
    8068            </span>
    81         <?php endif; // End if $tag_list ?>
     69        <?php endif; ?>
    8270    </footer><!-- .entry-meta -->
    83 </article><!-- #post-<?php the_ID(); ?> -->
     71</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/content.php

    r24832 r25021  
    44 * @subpackage Twenty_Fourteen
    55 */
    6 $format = get_post_format();
     6
    77?>
    88
    9 <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
     9<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1010    <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
    11         <?php
    12             if ( '' != get_the_post_thumbnail() )
    13                 the_post_thumbnail( 'featured-thumbnail-large' );
    14         ?>
     11        <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
    1512    </a>
    1613
    1714    <header class="entry-header">
    18         <?php
    19             /* translators: used between list items, there is a space after the comma */
    20             $categories_list = get_the_category_list( __( ', ', 'twentyfourteen' ) );
    21             if ( $categories_list && twentyfourteen_categorized_blog() && 'post' == get_post_type() ) :
    22         ?>
     15        <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    2316        <div class="entry-meta">
    24             <span class="cat-links"><?php echo $categories_list; ?></span>
     17            <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
    2518        </div>
    2619        <?php endif; ?>
     
    2922
    3023        <div class="entry-meta">
    31             <?php if ( 'gallery' == $format ) : ?>
     24            <?php if ( has_post_format( 'gallery' ) ) : ?>
    3225            <span class="post-format">
    33                 <a class="entry-format" href="<?php echo esc_url( get_post_format_link( get_post_format() ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( get_post_format() ) ) ); ?>"><?php echo get_post_format_string( get_post_format() ); ?></a>
     26                <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'gallery' ) ) ); ?>"><?php echo get_post_format_string( 'gallery' ); ?></a>
    3427            </span>
    35             <?php endif; ?>
     28            <?php
     29                endif;
    3630
    37             <?php
    3831                if ( 'post' == get_post_type() )
    3932                    twentyfourteen_posted_on();
     33
     34                if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
    4035            ?>
     36            <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
     37            <?php
     38                endif;
    4139
    42             <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
    43                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
    44             <?php endif; ?>
    45 
    46             <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
     40                edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
     41            ?>
    4742        </div><!-- .entry-meta -->
    4843    </header><!-- .entry-header -->
    4944
    5045    <?php if ( is_search() ) : ?>
    51     <div class="entry-summary clearfix">
     46    <div class="entry-summary">
    5247        <?php the_excerpt(); ?>
    5348    </div><!-- .entry-summary -->
    5449    <?php else : ?>
    55     <div class="entry-content clearfix">
    56         <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) ); ?>
     50    <div class="entry-content">
    5751        <?php
     52            the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
    5853            wp_link_pages( array(
    5954                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    6055                'after'       => '</div>',
    6156                'link_before' => '<span>',
    62                 'link_after'  => '</span>'
     57                'link_after'  => '</span>',
    6358            ) );
    6459        ?>
     
    6661    <?php endif; ?>
    6762
    68     <?php
    69         $tag_list = get_the_tag_list();
    70         if ( '' != $tag_list && 'post' == get_post_type() ) :
    71     ?>
    72         <footer class="entry-meta">
    73             <span class="tag-links"><?php echo $tag_list; ?></span>
    74         </footer><!-- .entry-meta -->
    75     <?php endif; // End if $tag_list ?>
    76 </article><!-- #post-<?php the_ID(); ?> -->
     63    <?php if ( has_tag() ) : ?>
     64    <footer class="entry-meta">
     65        <span class="tag-links"><?php echo get_the_tag_list(); ?></span>
     66    </footer><!-- .entry-meta -->
     67    <?php endif; ?>
     68</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfourteen/featured-content.php

    r24832 r25021  
    11<div class="featured-content-wrapper">
    2     <div id="featured-content" class="featured-content clearfix">
     2    <div id="featured-content" class="featured-content">
    33
    44        <?php
     
    88            foreach ( (array) $featured_posts as $order => $post ) :
    99                setup_postdata( $post );
     10
    1011                get_template_part( 'content', 'featured-post' );
    1112            endforeach;
  • trunk/src/wp-content/themes/twentyfourteen/footer.php

    r24832 r25021  
    33 * The template for displaying the footer.
    44 *
    5  * Contains the closing of the id=main div and all content after
     5 * Contains footer content and the closing of the #main and #page div elements.
    66 *
    77 * @package WordPress
     
    1010?>
    1111
    12     </div><!-- #main .site-main -->
     12        </div><!-- #main -->
    1313
    14     <?php get_sidebar( 'footer' ); ?>
     14        <?php get_sidebar( 'footer' ); ?>
    1515
    16     <footer id="colophon" class="site-footer" role="contentinfo">
    17         <div class="site-info">
    18             <?php do_action( 'twentyfourteen_credits' ); ?>
    19             <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
    20         </div><!-- .site-info -->
    21     </footer><!-- #colophon .site-footer -->
    22 </div><!-- #page .hfeed .site -->
     16        <footer id="colophon" class="site-footer" role="contentinfo">
     17            <div class="site-info">
     18                <?php do_action( 'twentyfourteen_credits' ); ?>
     19                <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
     20            </div><!-- .site-info -->
     21        </footer><!-- #colophon -->
     22    </div><!-- #page -->
    2323
    24 <?php wp_footer(); ?>
    25 
     24    <?php wp_footer(); ?>
    2625</body>
    2726</html>
  • trunk/src/wp-content/themes/twentyfourteen/full-width-page.php

    r24832 r25021  
    99get_header(); ?>
    1010
    11 <?php if ( is_front_page() ) : ?>
    12 
    13     <div class="front-page-content-wrapper">
    14         <div class="front-page-content-main">
    15 
    16             <?php if ( twentyfourteen_has_featured_posts() ) : ?>
    17                 <?php get_template_part( 'featured-content' ); ?>
    18             <?php endif; ?>
    19 
    20             <div class="front-page-content-area clearfix">
    21 
    22                 <div id="primary" class="content-area no-sidebar">
    23                     <div id="content" class="site-content full-width" role="main">
    24                     <?php
    25                         if ( have_posts() ) :
    26                             while ( have_posts() ) :
    27                                 the_post();
    28                                 get_template_part( 'content', 'page' );
    29                                 comments_template( '', true );
    30                             endwhile;
    31 
    32                             twentyfourteen_content_nav( 'nav-below' );
    33                         else :
    34                             get_template_part( 'no-results', 'index' );
    35                         endif;
    36                     ?>
    37                     </div><!-- #content .site-content -->
    38                 </div><!-- #primary .content-area -->
    39 
    40             </div><!-- .front-page-content-area -->
    41 
    42         </div><!-- .front-page-content-main -->
    43     </div><!-- .front-page-content-wrapper -->
    44 
    45 <?php else : ?>
    46 
    4711    <div id="primary" class="content-area">
    4812        <div id="content" class="site-content full-width" role="main">
     13            <?php
     14                while ( have_posts() ) :
     15                    the_post();
    4916
    50             <?php while ( have_posts() ) : the_post(); ?>
     17                    get_template_part( 'content', 'page' );
    5118
    52                 <?php get_template_part( 'content', 'page' ); ?>
     19                    // If comments are open or we have at least one comment, load up the comment template.
     20                    if ( comments_open() || get_comments_number() )
     21                        comments_template();
     22                endwhile;
     23            ?>
     24        </div><!-- #content -->
     25    </div><!-- #primary -->
    5326
    54                 <?php comments_template( '', true ); ?>
    55 
    56             <?php endwhile; ?>
    57 
    58         </div><!-- #content .site-content -->
    59     </div><!-- #primary .content-area -->
    60 
    61 <?php endif; // is_front_page() check ?>
    62 
    63 <?php get_sidebar(); ?>
    64 
    65 <?php get_footer(); ?>
     27<?php
     28get_sidebar();
     29get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r24990 r25021  
    2828 * before the init hook. The init hook is too late for some features, such as indicating
    2929 * support post thumbnails.
    30  *
    3130 */
    3231function twentyfourteen_setup() {
    33     /**
    34      * Custom template tags for this theme.
    35      */
    36     require( get_template_directory() . '/inc/template-tags.php' );
    37 
    38     /**
    39      * Customizer additions
    40      */
    41     require( get_template_directory() . '/inc/customizer.php' );
    4232
    4333    /**
     
    8272     * This theme allows users to set a custom background.
    8373     */
    84     $args = apply_filters( 'twentyfourteen_custom_background_args', array( 'default-color' => 'f5f5f5' ) );
    85 
    86     if ( function_exists( 'wp_get_theme' ) ) {
    87         add_theme_support( 'custom-background', $args );
    88     } else {
    89         // Compat: Versions of WordPress prior to 3.4.
    90         define( 'BACKGROUND_COLOR', $args['default-color'] );
    91         add_custom_background();
    92     }
     74    add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array(
     75        'default-color' => 'f5f5f5',
     76    ) ) );
    9377}
    9478endif; // twentyfourteen_setup
     
    11397        return false;
    11498
    115     $minimum = absint( $minimum );
    11699    $featured_posts = apply_filters( 'twentyfourteen_get_featured_posts', array() );
    117100
    118     if ( ! is_array( $featured_posts ) )
    119         return false;
    120 
    121     if ( $minimum > count( $featured_posts ) )
    122         return false;
    123 
    124     return true;
     101    return is_array( $featured_posts ) && count( $featured_posts ) > absint( $minimum );
    125102}
    126103
     
    192169
    193170/**
    194  * Register Google fonts for Twenty Fourteen
     171 * Register Google fonts for Twenty Fourteen.
    195172 *
    196173 */
     
    198175    /* translators: If there are characters in your language that are not supported
    199176       by Lato, translate this to 'off'. Do not translate into your own language. */
    200     if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) {
    201 
    202         $protocol = is_ssl() ? 'https' : 'http';
    203 
    204         wp_register_style( 'twentyfourteen-lato', "$protocol://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic", array(), null );
    205     }
     177    if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) )
     178        wp_register_style( 'twentyfourteen-lato', '//fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic', array(), null );
    206179}
    207180add_action( 'init', 'twentyfourteen_fonts' );
     
    216189    wp_enqueue_style( 'twentyfourteen-lato' );
    217190
    218     if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
     191    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    219192        wp_enqueue_script( 'comment-reply' );
    220     }
    221 
    222     if ( is_singular() && wp_attachment_is_image() ) {
     193
     194    if ( is_singular() && wp_attachment_is_image() )
    223195        wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' );
    224     }
    225196
    226197    wp_enqueue_script( 'twentyfourteen-theme', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130402', true );
     
    232203 *
    233204 */
    234 function twentyfourteen_admin_fonts( $hook_suffix ) {
    235     if ( 'appearance_page_custom-header' != $hook_suffix )
    236         return;
    237 
     205function twentyfourteen_admin_fonts() {
    238206    wp_enqueue_style( 'twentyfourteen-lato' );
    239207}
    240 add_action( 'admin_enqueue_scripts', 'twentyfourteen_admin_fonts' );
     208add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' );
    241209
    242210/**
     
    285253}
    286254add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' );
     255
     256if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) :
     257/**
     258 * Prints the attached image with a link to the next attached image.
     259 *
     260 * @since Twenty Thirteen 1.0
     261 *
     262 * @return void
     263 */
     264function twentyfourteen_the_attached_image() {
     265    $post                = get_post();
     266    $attachment_size     = apply_filters( 'twentyfourteen_attachment_size', array( 1200, 1200 ) );
     267    $next_attachment_url = wp_get_attachment_url();
     268
     269    /**
     270     * Grab the IDs of all the image attachments in a gallery so we can get the URL
     271     * of the next adjacent image in a gallery, or the first image (if we're
     272     * looking at the last image in a gallery), or, in a gallery of one, just the
     273     * link to that image file.
     274     */
     275    $attachment_ids = get_posts( array(
     276        'post_parent'    => $post->post_parent,
     277        'fields'         => 'ids',
     278        'numberposts'    => -1,
     279        'post_status'    => 'inherit',
     280        'post_type'      => 'attachment',
     281        'post_mime_type' => 'image',
     282        'order'          => 'ASC',
     283        'orderby'        => 'menu_order ID'
     284    ) );
     285
     286    // If there is more than 1 attachment in a gallery...
     287    if ( count( $attachment_ids ) > 1 ) {
     288        foreach ( $attachment_ids as $attachment_id ) {
     289            if ( $attachment_id == $post->ID ) {
     290                $next_id = current( $attachment_ids );
     291                break;
     292            }
     293        }
     294
     295        // get the URL of the next image attachment...
     296        if ( $next_id )
     297            $next_attachment_url = get_attachment_link( $next_id );
     298
     299        // or get the URL of the first image attachment.
     300        else
     301            $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
     302    }
     303
     304    printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
     305        esc_url( $next_attachment_url ),
     306        the_title_attribute( array( 'echo' => false ) ),
     307        wp_get_attachment_image( $post->ID, $attachment_size )
     308    );
     309}
     310endif;
    287311
    288312/**
     
    329353
    330354    if ( $class )
    331         echo 'class="clearfix ' . $class . '"';
     355        printf( 'class="%s"', $class );
    332356}
    333357
     
    445469}
    446470add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
     471
     472/**
     473 * Custom template tags for this theme.
     474 */
     475require get_template_directory() . '/inc/template-tags.php';
     476
     477/**
     478 * Customizer additions
     479 */
     480require get_template_directory() . '/inc/customizer.php';
  • trunk/src/wp-content/themes/twentyfourteen/header.php

    r24832 r25021  
    1111<html <?php language_attributes(); ?> class="no-js">
    1212<head>
    13 <script>
    14 /**
    15  * Replaces class "no-js" with "js" in the <html>-tag when JavaScript is being used.
    16  * Allows easy styling for browsers [not] supporting/running JavaScript.
    17  */
    18 document.documentElement.className = document.documentElement.className.replace(/(\s|^)no-js(\s|$)/, '$1js$2');
    19 </script>
    2013<meta charset="<?php bloginfo( 'charset' ); ?>" />
    2114<meta name="viewport" content="width=device-width" />
     
    6053
    6154    <?php $header_image = get_header_image();
    62     if ( ! empty( $header_image ) ) { ?>
     55    if ( ! empty( $header_image ) ) : ?>
    6356    <div id="site-header">
    6457        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
     
    6659        </a>
    6760    </div>
    68     <?php } ?>
     61    <?php endif; ?>
    6962
    70     <header id="masthead" class="site-header clearfix" role="banner">
    71         <div class="header-main clearfix">
     63    <header id="masthead" class="site-header" role="banner">
     64        <div class="header-main clear">
    7265            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    7366
     
    8578
    8679            <nav role="navigation" class="site-navigation primary-navigation">
    87                 <h1 class="assistive-text"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1>
    88                 <div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyfourteen' ); ?>"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a></div>
     80                <h1 class="screen-reader-text"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1>
     81                <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyfourteen' ); ?>"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a></div>
    8982                <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    9083            </nav>
     
    9689        <?php if ( $social_links ) : ?>
    9790            <div class="social-links-wrapper hide">
    98                 <ul class="social-links clearfix">
     91                <ul class="social-links clear">
    9992                    <?php if ( is_email( $email_link ) ) : ?>
    10093                    <li class="email-link">
     
    189182
    190183        <div class="search-box-wrapper hide">
    191             <div class="search-box clearfix">
     184            <div class="search-box clear">
    192185            <?php get_search_form(); ?>
    193186            </div>
    194187        </div>
    195     </header><!-- #masthead .site-header -->
     188    </header><!-- #masthead -->
    196189
    197     <div id="main" class="site-main clearfix">
     190    <div id="main" class="site-main">
  • trunk/src/wp-content/themes/twentyfourteen/image.php

    r24832 r25021  
    1010?>
    1111
    12 <div id="primary" class="content-area image-attachment">
     12<section id="primary" class="content-area image-attachment">
    1313    <div id="content" class="site-content full-width" role="main">
    1414
     
    1717        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1818            <header class="entry-header">
    19                 <h1 class="entry-title"><?php the_title(); ?></h1>
     19                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    2020
    2121                <div class="entry-meta">
     
    3232
    3333            <div class="entry-content">
    34 
    3534                <div class="entry-attachment">
    3635                    <div class="attachment">
    37                         <?php
    38                             /**
    39                              * 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,
    40                              * 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
    41                              */
    42                             $attachments = array_values( get_children( array(
    43                                 'post_parent'    => $post->post_parent,
    44                                 'post_status'    => 'inherit',
    45                                 'post_type'      => 'attachment',
    46                                 'post_mime_type' => 'image',
    47                                 'order'          => 'ASC',
    48                                 'orderby'        => 'menu_order ID'
    49                             ) ) );
    50                             foreach ( $attachments as $k => $attachment ) {
    51                                 if ( $attachment->ID == $post->ID )
    52                                     break;
    53                             }
    54                             $k++;
    55                             // If there is more than 1 attachment in a gallery
    56                             if ( count( $attachments ) > 1 ) {
    57                                 if ( isset( $attachments[ $k ] ) )
    58                                     // get the URL of the next image attachment
    59                                     $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    60                                 else
    61                                     // or get the URL of the first image attachment
    62                                     $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
    63                             } else {
    64                                 // or, if there's only 1 image, get the URL of the image
    65                                 $next_attachment_url = wp_get_attachment_url();
    66                             }
    67                         ?>
    68 
    69                         <a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
    70                             $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 1200, 1200 ) ); // Filterable image size.
    71                             echo wp_get_attachment_image( $post->ID, $attachment_size );
    72                         ?></a>
     36                        <?php twentyfourteen_the_attached_image(); ?>
    7337                    </div><!-- .attachment -->
    7438
    75                     <?php if ( ! empty( $post->post_excerpt ) ) : ?>
     39                    <?php if ( has_excerpt() ) : ?>
    7640                    <div class="entry-caption">
    7741                        <?php the_excerpt(); ?>
     
    8044                </div><!-- .entry-attachment -->
    8145
    82                 <?php the_content(); ?>
    8346                <?php
     47                    the_content();
    8448                    wp_link_pages( array(
    8549                        'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    8650                        'after'       => '</div>',
    8751                        'link_before' => '<span>',
    88                         'link_after'  => '</span>'
     52                        'link_after'  => '</span>',
    8953                    ) );
    9054                ?>
     
    9256
    9357            <footer class="entry-meta">
    94                 <?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
    95                     <?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() ); ?>
    96                 <?php elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open ?>
    97                     <?php printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() ); ?>
    98                 <?php elseif ( comments_open() && ! pings_open() ) : // Only comments open ?>
    99                     <?php _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', 'twentyfourteen' ); ?>
    100                 <?php elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed ?>
    101                     <?php _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' ); ?>
    102                 <?php endif; ?>
     58                <?php
     59                    if ( comments_open() && pings_open() ) : // Comments and trackbacks open
     60                        printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     61                    elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
     62                        printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     63                    elseif ( comments_open() && ! pings_open() ) : // Only comments open
     64                        _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', 'twentyfourteen' );
     65                    elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
     66                        _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' );
     67                    endif;
     68                ?>
    10369            </footer><!-- .entry-meta -->
    104         </article><!-- #post-<?php the_ID(); ?> -->
     70        </article><!-- #post-## -->
    10571
    10672        <nav id="image-navigation" class="site-navigation">
     
    11379    <?php endwhile; // end of the loop. ?>
    11480
    115     </div><!-- #content .site-content -->
    116 </div><!-- #primary .content-area .image-attachment -->
     81    </div><!-- #content -->
     82</section><!-- #primary -->
    11783
    118 <?php get_sidebar(); ?>
    119 
    120 <?php get_footer(); ?>
     84<?php
     85get_sidebar();
     86get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php

    r24832 r25021  
    2323 */
    2424function twentyfourteen_custom_header_setup() {
    25     $args = array(
    26         'default-image'          => '',
     25    add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array(
    2726        'default-text-color'     => 'fff',
    2827        'width'                  => 1260,
     
    3231        'admin-head-callback'    => 'twentyfourteen_admin_header_style',
    3332        'admin-preview-callback' => 'twentyfourteen_admin_header_image',
    34     );
     33    ) ) );
    3534
    36     $args = apply_filters( 'twentyfourteen_custom_header_args', $args );
    37 
    38     if ( function_exists( 'wp_get_theme' ) ) {
    39         add_theme_support( 'custom-header', $args );
    40     } else {
    41         // Compat: Versions of WordPress prior to 3.4.
    42         define( 'HEADER_TEXTCOLOR',    $args['default-text-color'] );
    43         define( 'HEADER_IMAGE',        $args['default-image'] );
    44         define( 'HEADER_IMAGE_WIDTH',  $args['width'] );
    45         define( 'HEADER_IMAGE_HEIGHT', $args['height'] );
    46         add_custom_image_header( $args['wp-head-callback'], $args['admin-head-callback'], $args['admin-preview-callback'] );
    47     }
    4835}
    4936add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' );
    50 
    51 /**
    52  * Shiv for get_custom_header().
    53  *
    54  * get_custom_header() was introduced to WordPress
    55  * in version 3.4. To provide backward compatibility
    56  * with previous versions, we will define our own version
    57  * of this function.
    58  *
    59  * @todo Remove this function when WordPress 3.6 is released.
    60  * @return stdClass All properties represent attributes of the curent header image.
    61  *
    62  * @package WordPress
    63  * @subpackage Twenty_Fourteen
    64  */
    65 
    66 if ( ! function_exists( 'get_custom_header' ) ) {
    67     function get_custom_header() {
    68         return (object) array(
    69             'url'           => get_header_image(),
    70             'thumbnail_url' => get_header_image(),
    71             'width'         => HEADER_IMAGE_WIDTH,
    72             'height'        => HEADER_IMAGE_HEIGHT,
    73         );
    74     }
    75 }
    7637
    7738if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
     
    8344 */
    8445function twentyfourteen_header_style() {
     46    $header_text_color = get_header_textcolor();
    8547
    8648    // If no custom options for text are set, let's bail
    87     // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
    88     if ( HEADER_TEXTCOLOR == get_header_textcolor() )
     49    // $header_text_color options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value
     50    if ( HEADER_TEXTCOLOR == $header_text_color )
    8951        return;
    9052    // If we get this far, we have custom styles. Let's do this.
     
    9355    <?php
    9456        // Has the text been hidden?
    95         if ( 'blank' == get_header_textcolor() ) :
     57        if ( 'blank' == $header_text_color ) :
    9658    ?>
    9759        .site-title {
     
    10567    ?>
    10668        .site-title a  {
    107             color: #<?php echo get_header_textcolor(); ?> !important;
     69            color: #<?php echo $header_text_color; ?> !important;
    10870        }
    10971    <?php endif; ?>
     
    154116 *
    155117 */
    156 function twentyfourteen_admin_header_image() { ?>
     118function twentyfourteen_admin_header_image() {
     119    $header_image = get_header_image();
     120?>
    157121    <div id="headimg">
    158         <?php
    159         if ( 'blank' == get_header_textcolor() || '' == get_header_textcolor() )
    160             $style = ' style="display:none;"';
    161         else
    162             $style = ' style="color:#' . get_header_textcolor() . ';"';
    163         ?>
    164         <?php $header_image = get_header_image();
    165         if ( ! empty( $header_image ) ) : ?>
    166             <img src="<?php echo esc_url( $header_image ); ?>" alt="" />
     122        <?php if ( ! empty( $header_image ) ) : ?>
     123        <img src="<?php echo esc_url( $header_image ); ?>" alt="">
    167124        <?php endif; ?>
    168         <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
     125        <h1 class="displaying-header-text"><a id="name"<?php echo sprintf( ' style="color:#%s;"', get_header_textcolor() ); ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    169126    </div>
    170 <?php }
     127<?php
     128}
    171129endif; // twentyfourteen_admin_header_image
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r24832 r25021  
    3636    ?>
    3737    <nav role="navigation" id="<?php echo $nav_id; ?>" class="<?php echo $nav_class; ?>">
    38         <h1 class="assistive-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1>
     38        <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1>
    3939
    4040    <?php if ( is_single() ) : // navigation links for single posts ?>
     
    183183}
    184184add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' );
    185 add_action( 'save_post', 'twentyfourteen_category_transient_flusher' );
     185add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
    186186
    187187/**
     
    190190 */
    191191function twentyfourteen_get_template_part() {
    192 
    193     $format = get_post_format();
    194 
    195     switch( $format ) {
    196         case 'aside':
    197         case 'quote':
    198         case 'link':
    199         case 'video':
    200         case 'image':
    201             get_template_part( 'content', 'post-format' );
    202             break;
    203         default:
    204             get_template_part( 'content', get_post_format() );
    205             break;
    206     }
    207 
     192    if ( has_post_format( array( 'aside', 'quote', 'link', 'video', 'image' ) ) )
     193        get_template_part( 'content', 'post-format' );
     194    else
     195        get_template_part( 'content', get_post_format() );
    208196}
  • trunk/src/wp-content/themes/twentyfourteen/index.php

    r24832 r25021  
    1515get_header(); ?>
    1616
    17 <?php if ( is_front_page() ) : ?>
    18 
    19     <div class="front-page-content-wrapper">
    20         <div class="front-page-content-main">
    21 
    22             <?php if ( twentyfourteen_has_featured_posts() ) : ?>
    23                 <?php get_template_part( 'featured-content' ); ?>
    24             <?php endif; ?>
    25 
    26             <div class="front-page-content-area clearfix">
    27 
    28                 <div id="primary" class="content-area no-sidebar">
    29                     <div id="content" class="site-content" role="main">
    30                     <?php
    31                         if ( have_posts() ) :
    32                             while ( have_posts() ) :
    33                                 the_post();
    34                                 twentyfourteen_get_template_part();
    35                             endwhile;
    36 
    37                             twentyfourteen_content_nav( 'nav-below' );
    38                         else :
    39                             get_template_part( 'no-results', 'index' );
    40                         endif;
    41                     ?>
    42                     </div><!-- #content .site-content -->
    43                 </div><!-- #primary .content-area -->
    44 
    45                 <?php get_template_part( 'recent-formatted-posts' ); ?>
    46 
    47             </div><!-- .front-page-content-area -->
    48 
    49         </div><!-- .front-page-content-main -->
    50     </div><!-- .front-page-content-wrapper -->
    51 
    52     <?php get_sidebar(); ?>
    53 
    54 <?php else : ?>
    55 
    5617    <div id="primary" class="content-area">
    5718        <div id="content" class="site-content" role="main">
    5819
    59         <?php if ( have_posts() ) : ?>
     20        <?php
     21            if ( have_posts() ) :
     22                while ( have_posts() ) :
     23                    the_post();
    6024
    61             <?php while ( have_posts() ) : the_post(); ?>
     25                    twentyfourteen_get_template_part();
     26                endwhile;
     27                twentyfourteen_content_nav( 'nav-below' );
    6228
    63                 <?php twentyfourteen_get_template_part(); ?>
     29            else :
     30                get_template_part( 'no-results', 'index' );
    6431
    65             <?php endwhile; ?>
     32            endif;
     33        ?>
    6634
    67             <?php twentyfourteen_content_nav( 'nav-below' ); ?>
     35        </div><!-- #content -->
     36    </div><!-- #primary -->
    6837
    69         <?php else : ?>
    70 
    71             <?php get_template_part( 'no-results', 'index' ); ?>
    72 
    73         <?php endif; ?>
    74 
    75         </div><!-- #content .site-content -->
    76     </div><!-- #primary .content-area -->
    77 
    78     <?php get_sidebar( 'content' ); ?>
    79 
    80     <?php get_sidebar(); ?>
    81 
    82 <?php endif; // is_front_page() check ?>
    83 
    84 <?php get_footer(); ?>
     38<?php
     39get_sidebar( 'content' );
     40get_sidebar();
     41get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/no-results.php

    r24832 r25021  
    11<?php
    22/**
    3  * The template part for displaying a message that posts cannot be found.
    4  *
    5  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     3 * The template for displaying a "No posts found" message.
    64 *
    75 * @package WordPress
     
    108?>
    119
    12 <article id="post-0" class="post no-results not-found">
    13     <header class="entry-header">
    14         <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyfourteen' ); ?></h1>
    15     </header><!-- .entry-header -->
     10<header class="page-header">
     11    <h1 class="page-title"><?php _e( 'Nothing Found', 'twentyfourteen' ); ?></h1>
     12</header>
    1613
    17     <div class="entry-content">
    18         <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
     14<div class="page-content">
     15    <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
    1916
    20             <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfourteen' ), admin_url( 'post-new.php' ) ); ?></p>
     17    <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentyfourteen' ), admin_url( 'post-new.php' ) ); ?></p>
    2118
    22         <?php elseif ( is_search() ) : ?>
     19    <?php elseif ( is_search() ) : ?>
    2320
    24             <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfourteen' ); ?></p>
    25             <?php get_search_form(); ?>
     21    <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfourteen' ); ?></p>
     22    <?php get_search_form(); ?>
    2623
    27         <?php else : ?>
     24    <?php else : ?>
    2825
    29             <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfourteen' ); ?></p>
    30             <?php get_search_form(); ?>
     26    <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfourteen' ); ?></p>
     27    <?php get_search_form(); ?>
    3128
    32         <?php endif; ?>
    33     </div><!-- .entry-content -->
    34 </article><!-- #post-0 .post .no-results .not-found -->
     29    <?php endif; ?>
     30</div><!-- .page-content -->
  • trunk/src/wp-content/themes/twentyfourteen/page.php

    r24832 r25021  
    1414get_header(); ?>
    1515
    16 <?php if ( is_front_page() ) : ?>
    17 
    18     <div class="front-page-content-wrapper">
    19         <div class="front-page-content-main">
    20 
    21             <?php if ( twentyfourteen_has_featured_posts() ) : ?>
    22                 <?php get_template_part( 'featured-content' ); ?>
    23             <?php endif; ?>
    24 
    25             <div class="front-page-content-area clearfix">
    26 
    27                 <div id="primary" class="content-area no-sidebar">
    28                     <div id="content" class="site-content" role="main">
    29                     <?php
    30                         if ( have_posts() ) :
    31                             while ( have_posts() ) :
    32                                 the_post();
    33                                 get_template_part( 'content', 'page' );
    34                                 comments_template( '', true );
    35                             endwhile;
    36 
    37                             twentyfourteen_content_nav( 'nav-below' );
    38                         else :
    39                             get_template_part( 'no-results', 'index' );
    40                         endif;
    41                     ?>
    42                     </div><!-- #content .site-content -->
    43                 </div><!-- #primary .content-area -->
    44 
    45                 <?php get_template_part( 'recent-formatted-posts' ); ?>
    46 
    47             </div><!-- .front-page-content-area -->
    48 
    49         </div><!-- .front-page-content-main -->
    50     </div><!-- .front-page-content-wrapper -->
    51 
    52     <?php get_sidebar(); ?>
    53 
    54 <?php else : ?>
    55 
    5616    <div id="primary" class="content-area">
    5717        <div id="content" class="site-content" role="main">
    5818
    59             <?php while ( have_posts() ) : the_post(); ?>
     19            <?php
     20                while ( have_posts() ) :
     21                    the_post();
    6022
    61                 <?php get_template_part( 'content', 'page' ); ?>
     23                    get_template_part( 'content', 'page' );
    6224
    63                 <?php comments_template( '', true ); ?>
    64 
    65             <?php endwhile; ?>
     25                    // If comments are open or we have at least one comment, load up the comment template.
     26                    if ( comments_open() || get_comments_number() )
     27                        comments_template();
     28                endwhile;
     29            ?>
    6630
    6731        </div><!-- #content .site-content -->
    6832    </div><!-- #primary .content-area -->
    6933
    70     <?php get_sidebar( 'content' ); ?>
    71 
    72     <?php get_sidebar(); ?>
    73 
    74 <?php endif; // is_front_page() check ?>
    75 
    76 <?php get_footer(); ?>
     34<?php
     35get_sidebar( 'content' );
     36get_sidebar();
     37get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/search.php

    r24832 r25021  
    1212    <div id="content" class="site-content" role="main">
    1313
    14     <?php if ( have_posts() ) : ?>
     14        <?php if ( have_posts() ) : ?>
    1515
    1616        <header class="page-header">
    17             <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
     17            <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?></h1>
    1818        </header><!-- .page-header -->
    1919
    20         <?php while ( have_posts() ) : the_post(); ?>
     20        <?php
     21                while ( have_posts() ) :
     22                    the_post();
    2123
    22             <?php twentyfourteen_get_template_part(); ?>
     24                    twentyfourteen_get_template_part();
     25                endwhile;
    2326
    24         <?php endwhile; ?>
     27                twentyfourteen_content_nav( 'nav-below' );
    2528
    26         <?php twentyfourteen_content_nav( 'nav-below' ); ?>
     29            else :
     30                get_template_part( 'no-results', 'search' );
    2731
    28     <?php else : ?>
     32            endif;
     33        ?>
    2934
    30         <?php get_template_part( 'no-results', 'search' ); ?>
     35    </div><!-- #content -->
     36</section><!-- #primary -->
    3137
    32     <?php endif; ?>
    33 
    34     </div><!-- #content .site-content -->
    35 </section><!-- #primary .content-area -->
    36 
    37 <?php get_sidebar( 'content' ); ?>
    38 
    39 <?php get_sidebar(); ?>
    40 
    41 <?php get_footer(); ?>
     38<?php
     39get_sidebar( 'content' );
     40get_sidebar();
     41get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/searchform.php

    r24832 r25021  
    77 */
    88?>
    9     <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
    10         <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyfourteen' ); ?></label>
    11         <input type="text" class="field" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="s" placeholder="<?php esc_attr_e( 'Search &hellip;', 'twentyfourteen' ); ?>" />
    12         <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyfourteen' ); ?>" />
    13     </form>
     9<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
     10    <label>
     11        <span class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'twentyfourteen' ); ?></span>
     12        <input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentyfourteen' ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" title="<?php _ex( 'Search for:', 'label', 'twentyfourteen' ); ?>">
     13    </label>
     14    <input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentyfourteen' ); ?>">
     15</form>
  • trunk/src/wp-content/themes/twentyfourteen/sidebar.php

    r24832 r25021  
    99<div id="secondary">
    1010    <div id="secondary-top">
    11     <?php
    12         $description = get_bloginfo( 'description' );
    13         if ( ! empty ( $description ) ) : ?>
     11        <?php
     12            $description = get_bloginfo( 'description' );
     13            if ( ! empty ( $description ) ) :
     14        ?>
    1415        <h2 class="site-description"><?php echo esc_html( $description ); ?></h2>
    15     <?php endif; ?>
     16        <?php endif; ?>
    1617
    17     <?php if ( has_nav_menu( 'secondary' ) ) : ?>
    18         <nav role="navigation" class="site-navigation secondary-navigation">
     18        <?php if ( has_nav_menu( 'secondary' ) ) : ?>
     19        <nav role="navigation" class="navigation secondary-navigation">
    1920            <?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
    2021        </nav>
    21     <?php endif; ?>
     22        <?php endif; ?>
    2223    </div>
    2324
    2425    <div id="secondary-bottom" class="widget-area" role="complementary">
    25     <?php do_action( 'before_sidebar' ); ?>
    26 
    27     <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
    28         <aside id="categories" class="widget widget_categories">
    29             <h1 class="widget-title"><?php _e( 'Categories', 'twentyfourteen' ); ?></h1>
    30             <ul>
    31                 <?php wp_list_categories( array( 'title_li' => '' ) ); ?>
    32             </ul>
    33         </aside>
    34 
    35         <aside id="archives" class="widget widget_archive">
    36             <h1 class="widget-title"><?php _e( 'Archives', 'twentyfourteen' ); ?></h1>
    37             <ul>
    38                 <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
    39             </ul>
    40         </aside>
    41     <?php endif; // end sidebar widget area ?>
     26        <?php
     27            do_action( 'before_sidebar' );
     28            dynamic_sidebar( 'sidebar-1' );
     29        ?>
    4230    </div><!-- .widget-area -->
    4331</div><!-- #secondary -->
  • trunk/src/wp-content/themes/twentyfourteen/single.php

    r24832 r25021  
    1111<div id="primary" class="content-area">
    1212    <div id="content" class="site-content" role="main">
     13        <?php
     14            while ( have_posts() ) :
     15                the_post();
    1316
    14     <?php while ( have_posts() ) : the_post(); ?>
     17                get_template_part( 'content', 'single' );
    1518
    16         <?php get_template_part( 'content', 'single' ); ?>
     19                twentyfourteen_content_nav( 'nav-below' );
    1720
    18         <?php twentyfourteen_content_nav( 'nav-below' ); ?>
     21                // If comments are open or we have at least one comment, load up the comment template.
     22                if ( comments_open() || get_comments_number() )
     23                    comments_template();
     24            endwhile;
     25        ?>
     26    </div><!-- #content -->
     27</div><!-- #primary -->
    1928
    20         <?php
    21             // If comments are open or we have at least one comment, load up the comment template
    22             if ( comments_open() || '0' != get_comments_number() )
    23                 comments_template( '', true );
    24         ?>
    25 
    26     <?php endwhile; // end of the loop. ?>
    27 
    28     </div><!-- #content .site-content -->
    29 </div><!-- #primary .content-area -->
    30 
    31 <?php get_sidebar( 'content' ); ?>
    32 
    33 <?php get_sidebar(); ?>
    34 
    35 <?php get_footer(); ?>
     29<?php
     30get_sidebar( 'content' );
     31get_sidebar();
     32get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r24991 r25021  
    435435    width: 100%;
    436436}
    437 #searchform input[type="text"] {
     437.search-field {
    438438    width: 100%;
    439439}
     
    488488}
    489489
    490 /* Text meant only for screen readers */
    491 .assistive-text {
    492     clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
     490/* Assistive text */
     491.screen-reader-text {
    493492    clip: rect(1px, 1px, 1px, 1px);
    494493    position: absolute !important;
     494}
     495
     496.screen-reader-text:focus {
     497    background-color: #f1f1f1;
     498    border-radius: 3px;
     499    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
     500    clip: auto !important;
     501    color: #21759b;
     502    display: block;
     503    font-size: 14px;
     504    font-weight: bold;
     505    height: auto;
     506    line-height: normal;
     507    padding: 15px 23px 14px;
     508    position: absolute;
     509    left: 5px;
     510    top: 5px;
     511    text-decoration: none;
     512    width: auto;
     513    z-index: 100000; /* Above WP toolbar */
    495514}
    496515
     
    500519}
    501520
    502 /* Clearing floats */
    503 .clearfix:after {
     521/* Clearing */
     522.clear:before,
     523.clear:after,
     524[class*="content"]:before,
     525[class*="content"]:after,
     526[class*="site"]:before,
     527[class*="site"]:after {
     528    content: '';
     529    display: table;
     530}
     531
     532.clear:after,
     533[class*="content"]:after,
     534[class*="site"]:after {
    504535    clear: both;
    505 }
    506 .clearfix:before,
    507 .clearfix:after {
    508     display: table;
    509     content: "";
    510536}
    511537
     
    772798    background-color: #35921f;
    773799}
    774 .search-box #searchform input[type="text"] {
     800.search-box .search-field {
    775801    background-color: #fff;
    776802    float: right;
     
    10331059}
    10341060.entry-content,
     1061.page-content,
    10351062.entry-summary {
    10361063    position: relative;
    10371064    z-index: 2;
    10381065}
    1039 .entry-content a {
     1066.entry-content a,
     1067.page-content a, {
    10401068    text-decoration: underline;
    10411069}
     
    10761104
    10771105/* #primary specific styles */
    1078 #primary .entry-header {
     1106#primary .entry-header,
     1107#primary .page-header {
    10791108    background-color: #fff;
    10801109    padding: 24px 10px 12px;
    10811110    padding: 2.4rem 1.0rem 1.2rem;
    10821111}
    1083 #primary .entry-title {
     1112#primary .entry-title,
     1113#primary .page-title {
    10841114    font-size: 33px;
    10851115    font-size: 3.3rem;
     
    10971127}
    10981128#primary .entry-content,
     1129#primary .page-content,
    10991130#primary .entry-summary {
    11001131    background-color: #fff;
     
    11661197/* Page specific styles */
    11671198.page #primary .entry-header,
    1168 .error404 #primary .entry-header,
     1199.error404 #primary .page-header,
    11691200.single-attachment #primary .entry-header,
    11701201.page #primary .entry-content,
    1171 .error404 #primary .entry-content,
     1202.error404 #primary .page-content,
    11721203.single-attachment #primary .entry-content {
    11731204    padding-top: 0;
     
    12761307/* For Firefox to avoid jagged edge */
    12771308@-moz-document url-prefix() {
    1278   .tag-links a:before {
    1279      border-right: 10px solid #8c8c8c;
     1309    .tag-links a:before {
     1310        border-right: 10px solid #8c8c8c;
    12801311        left: -10px;
    12811312        left: -1.0rem;
    1282   }
     1313    }
    12831314}
    12841315.tag-links a:hover:before {
     
    15531584----------------------------------------------- */
    15541585
    1555 .error404 .entry-content #searchform {
     1586.error404 .page-content .search-form {
    15561587    margin-bottom: 36px;
    15571588    margin-bottom: 3.6rem;
    15581589}
    1559 .error404 .entry-content .widget-title,
    1560 .error404 .entry-content .widgettitle {
     1590.error404 .page-content .widget-title,
     1591.error404 .page-content .widgettitle {
    15611592    border-top: 5px solid #000;
    15621593    color: #2b2b2b;
     
    15691600----------------------------------------------- */
    15701601
     1602img {
     1603    max-width: 100%;
     1604    height: auto;
     1605}
    15711606#site-header img,
    15721607.attachment-featured-thumbnail-large,
     
    15741609.comment-content img,
    15751610.widget img {
    1576     max-width: 100%;
    15771611    vertical-align: middle;
    1578 }
    1579 #site-header img,
    1580 .entry-content img,
    1581 .attachment-featured-thumbnail-large,
    1582 img[class*="align"],
    1583 img[class*="wp-image-"],
    1584 .widget img {
    1585     height: auto;
    1586 }
    1587 #site-header img,
    1588 .entry-content img,
    1589 img.size-full,
    1590 img.size-large,
    1591 img.wp-post-image {
    1592     max-width: 100%;
    1593     height: auto;
    15941612}
    15951613.attachment-featured-featured img,
     
    16161634    margin-bottom: 0.7rem;
    16171635}
    1618 .entry-content img.wp-smiley,
    1619 .comment-content img.wp-smiley {
     1636.wp-smiley {
    16201637    border: none;
    16211638    margin-bottom: 0;
     
    18521869    padding: 0 1.0rem;
    18531870}
    1854 .commentlist {
     1871.comment-list {
    18551872    list-style: none;
    18561873    margin: 0 0 48px 0;
     
    18711888}
    18721889.comment-meta a,
    1873 .commentlist li.trackback a,
    1874 .commentlist li.pingback a {
     1890.comment-list li.trackback a,
     1891.comment-list li.pingback a {
    18751892    color: #8c8c8c;
    18761893}
    18771894.comment-author a:hover,
    18781895.comment-meta a:hover,
    1879 .commentlist li.trackback a:hover,
    1880 .commentlist li.pingback a:hover {
     1896.comment-list li.trackback a:hover,
     1897.comment-list li.pingback a:hover {
    18811898    color: #41a62a;
    18821899    text-decoration: none;
     
    18881905}
    18891906.comments-area article,
    1890 .commentlist li.trackback,
    1891 .commentlist li.pingback {
     1907.comment-list li.trackback,
     1908.comment-list li.pingback {
    18921909    border-top: 1px solid rgba(0, 0, 0, 0.1);
    18931910    margin-bottom: 24px;
     
    18961913    padding: 2.4rem 1.0rem 0;
    18971914}
    1898 .commentlist li:first-child article {
     1915.comment-list li:first-child article {
    18991916    border: none;
    19001917}
     
    19591976    margin-bottom: 0;
    19601977}
    1961 .commentlist .children {
     1978.comment-list .children {
    19621979    list-style: none;
    19631980    margin-left: 20px;
     
    23162333
    23172334/* Search widget */
    2318 #searchsubmit {
     2335.search-submit {
    23192336    display: none;
    23202337}
     
    28532870    }
    28542871    .page #primary .entry-header,
    2855     .error404 #primary .entry-header {
     2872    .error404 #primary .page-header {
    28562873        margin: 0 4.59183673%;
    28572874        padding: 0 4.46428571% 12px;
     
    28872904    }
    28882905    .comments-area article,
    2889     .commentlist li.trackback,
    2890     .commentlist li.pingback {
     2906    .comment-list li.trackback,
     2907    .comment-list li.pingback {
    28912908        margin-bottom: 36px;
    28922909        margin-bottom: 3.6rem;
     
    29142931    #comments #respond,
    29152932    .comments-area article,
    2916     .commentlist li.trackback,
    2917     .commentlist li.pingback,
     2933    .comment-list li.trackback,
     2934    .comment-list li.pingback,
    29182935    .post-navigation .nav-previous,
    29192936    .post-navigation .nav-next {
     
    29342951    .full-width #comments #respond,
    29352952    .full-width .comments-area article,
    2936     .full-width .commentlist li.trackback,
    2937     .full-width .commentlist li.pingback {
     2953    .full-width .comment-list li.trackback,
     2954    .full-width .comment-list li.pingback {
    29382955        padding-right: 6.04307432%;
    29392956        padding-left: 6.04307432%;
     
    29883005    }
    29893006    .page #primary .entry-header,
    2990     .error404 #primary .entry-header {
     3007    .error404 #primary .page-header {
    29913008        margin: 0 8.03571428% 0 12.5%;
    29923009    }
     
    30173034    #comments #respond,
    30183035    .comments-area article,
    3019     .commentlist li.trackback,
    3020     .commentlist li.pingback,
     3036    .comment-list li.trackback,
     3037    .comment-list li.pingback,
    30213038    .post-navigation .nav-previous,
    30223039    .post-navigation .nav-next {
     
    30273044        padding-right: 13.8900862%;
    30283045    }
    3029     .commentlist,
    3030     .full-width .commentlist {
     3046    .comment-list,
     3047    .full-width .comment-list {
    30313048        margin-left: -70px;
    30323049        margin-left: -7.0rem;
     
    30413058    .full-width #comments #respond,
    30423059    .full-width .comments-area article,
    3043     .full-width .commentlist li.trackback,
    3044     .full-width .commentlist li.pingback {
     3060    .full-width .comment-list li.trackback,
     3061    .full-width .comment-list li.pingback {
    30453062        padding-right: 11.30926724%;
    30463063        padding-left: 11.30926724%;
     
    30673084        background-color: #000;
    30683085        content: '';
     3086        display: block;
    30693087        height: 100%;
    30703088        min-height: 100%;
     
    31203138        width: 24.87804878%;
    31213139    }
    3122     #primary .entry-header {
     3140    #primary .entry-header,
     3141    #primary .page-header {
    31233142        margin: -48px 4.59183673% 0;
    31243143        margin: -4.8rem 4.59183673% 0;
     
    31273146    }
    31283147    #primary .entry-content,
     3148    #primary .page-content,
    31293149    #primary .entry-summary {
    31303150        margin: 0 4.59183673%;
     
    31863206    }
    31873207    .page #primary .entry-header,
    3188     .error404 #primary .entry-header {
     3208    .error404 #primary .page-header {
    31893209        margin: 0 4.59183673%;
    31903210        padding: 0 4.46428571% 12px;
     
    32013221    #primary .full-width .entry-header,
    32023222    #primary .full-width .entry-content,
     3223    #primary .full-width .page-content,
    32033224    #primary .full-width footer.entry-meta {
    32043225        margin: 0 5.882236%;
     
    32083229    #comments #respond,
    32093230    .comments-area article,
    3210     .commentlist li.trackback,
    3211     .commentlist li.pingback,
     3231    .comment-list li.trackback,
     3232    .comment-list li.pingback,
    32123233    .post-navigation .nav-previous,
    32133234    .post-navigation .nav-next {
     
    32153236        padding-left: 9.19765166%;
    32163237    }
    3217     .commentlist,
    3218     .full-width .commentlist {
     3238    .comment-list,
     3239    .full-width .comment-list {
    32193240        margin-left: 0;
    32203241    }
     
    32283249    .full-width #comments #respond,
    32293250    .full-width .comments-area article,
    3230     .full-width .commentlist li.trackback,
    3231     .full-width .commentlist li.pingback {
     3251    .full-width .comment-list li.trackback,
     3252    .full-width .comment-list li.pingback {
    32323253        padding-right: 5.882236%;
    32333254        padding-left: 5.882236%;
     
    32833304
    32843305@media screen and (min-width: 1150px) {
    3285     #primary .entry-header {
     3306    #primary .entry-header,
     3307    #primary .page-header {
    32863308        margin: -48px 8.03571428% 0 12.5%;
    32873309        margin: -4.8rem 8.03571428% 0 12.5%;
    32883310    }
    32893311    #primary .entry-content,
     3312    #primary .page-content,
    32903313    #primary .entry-summary {
    32913314        margin: 0 8.03571428% 0 12.5%;
     
    32993322    #comments #respond,
    33003323    .comments-area article,
    3301     .commentlist li.trackback,
    3302     .commentlist li.pingback,
     3324    .comment-list li.trackback,
     3325    .comment-list li.pingback,
    33033326    .post-navigation .nav-previous,
    33043327    .post-navigation .nav-next {
     
    33093332        padding-right: 13.73697916%;
    33103333    }
    3311     .commentlist,
    3312     .full-width .commentlist {
     3334    .comment-list,
     3335    .full-width .comment-list {
    33133336        margin-left: -70px;
    33143337        margin-left: -7.0rem;
     
    33223345    }
    33233346    .page #primary .entry-header,
    3324     .error404 #primary .entry-header {
     3347    .error404 #primary .page-header {
    33253348        margin: 0 8.03571428% 0 12.5%;
    33263349    }
    33273350    #primary .full-width .entry-header,
    33283351    #primary .full-width .entry-content,
     3352    #primary .full-width .page-content,
    33293353    #primary .full-width footer.entry-meta {
    33303354        margin: 0 11.21868265%;
     
    33363360    .full-width #comments #respond,
    33373361    .full-width .comments-area article,
    3338     .full-width .commentlist li.trackback,
    3339     .full-width .commentlist li.pingback {
     3362    .full-width .comment-list li.trackback,
     3363    .full-width .comment-list li.pingback {
    33403364        padding-right: 11.21868265%;
    33413365        padding-left: 11.21868265%;
     
    33663390    #primary .full-width .entry-header,
    33673391    #primary .full-width .entry-content,
     3392    #primary .full-width .page-content,
    33683393    #primary .full-width footer.entry-meta {
    33693394        margin: 0 0 0 11.21868265%;
     
    33753400    .full-width #comments #respond,
    33763401    .full-width .comments-area article,
    3377     .full-width .commentlist li.trackback,
    3378     .full-width .commentlist li.pingback {
     3402    .full-width .comment-list li.trackback,
     3403    .full-width .comment-list li.pingback {
    33793404        padding-right: 0;
    33803405    }
Note: See TracChangeset for help on using the changeset viewer.