Make WordPress Core


Ignore:
Timestamp:
08/15/2013 12:24:27 AM (13 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: second 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-post-format.php

    r25021 r25023  
    44 * @subpackage Twenty_Fourteen
    55 */
    6 $format = get_post_format();
    76?>
    87
    9 <article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
     8<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    109        <?php
    11                 if ( 'gallery' == $format ) :
    12                         $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
     10                if ( has_post_format( 'gallery' ) ) :
     11                        $images = get_children( array( 'post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
    1312                        if ( $images ) :
    14                                 $image = array_shift( $images ); ?>
     13                                $image = array_shift( $images );
     14                                ?>
    1515                                <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">
    1616                                <?php echo wp_get_attachment_image( $image->ID, 'featured-thumbnail-large' ); ?>
    17                                 </a><?php
     17                                </a>
     18                                <?php
    1819                        endif;
    1920                endif;
    … …  
    2122
    2223        <header class="entry-header">
    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() && 'post' == get_post_type() ) :
    27                 ?>
     24                <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    2825                <div class="entry-meta">
    29                         <span class="cat-links"><?php echo $categories_list; ?></span>
    30                 </div>
     26                        <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
     27                </div><!-- .entry-meta -->
    3128                <?php endif; ?>
    3229
    33                 <?php
    34                         /* Show title only if it exists */
    35                         the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h1>' );
    36                 ?>
     30                <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    3731
    3832                <div class="entry-meta">
Note: See TracChangeset for help on using the changeset viewer.