Make WordPress Core


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.

File:
1 edited

Legend:

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