Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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-## -->
Note: See TracChangeset for help on using the changeset viewer.