Make WordPress Core

Ticket #35110: bug_35110.diff

File bug_35110.diff, 6.1 KB (added by vtieu, 10 years ago)
  • wp-content/themes/twentythirteen/image.php

    commit d66439f8df032f80e091c797229add0c937868ed
    Author: Vince <vtieu7@gmail.com>
    Date:   Tue Dec 22 01:13:54 2015 -0500
    
        Bug #35110 - Missing Loop
    
    diff --git a/wp-content/themes/twentythirteen/image.php b/wp-content/themes/twentythirteen/image.php
    index 9f5f29b..0c8c45f 100644
    a b get_header(); ?> 
    1313
    1414        <div id="primary" class="content-area">
    1515                <div id="content" class="site-content" role="main">
    16                         <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
    17                                 <header class="entry-header">
    18                                         <h1 class="entry-title"><?php the_title(); ?></h1>
    19 
    20                                         <div class="entry-meta">
    21                                                 <?php
    22                                                         $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
    23                                                         $post_title = get_the_title( $post->post_parent );
    24                                                         if ( empty( $post_title ) || 0 == $post->post_parent )
    25                                                                 $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
    26 
    27                                                         printf( $published_text,
    28                                                                 esc_attr( get_the_date( 'c' ) ),
    29                                                                 esc_html( get_the_date() ),
    30                                                                 esc_url( get_permalink( $post->post_parent ) ),
    31                                                                 esc_attr( strip_tags( $post_title ) ),
    32                                                                 $post_title
    33                                                         );
    34 
    35                                                         $metadata = wp_get_attachment_metadata();
    36                                                         printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
    37                                                                 esc_url( wp_get_attachment_url() ),
    38                                                                 esc_attr__( 'Link to full-size image', 'twentythirteen' ),
    39                                                                 __( 'Full resolution', 'twentythirteen' ),
    40                                                                 $metadata['width'],
    41                                                                 $metadata['height']
    42                                                         );
    43 
    44                                                         edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
    45                                                 ?>
    46                                         </div><!-- .entry-meta -->
    47                                 </header><!-- .entry-header -->
    48 
    49                                 <div class="entry-content">
    50                                         <nav id="image-navigation" class="navigation image-navigation" role="navigation">
    51                                                 <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
    52                                                 <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
    53                                         </nav><!-- #image-navigation -->
    54 
    55                                         <div class="entry-attachment">
    56                                                 <div class="attachment">
    57                                                         <?php twentythirteen_the_attached_image(); ?>
    58 
    59                                                         <?php if ( has_excerpt() ) : ?>
    60                                                         <div class="entry-caption">
    61                                                                 <?php the_excerpt(); ?>
    62                                                         </div>
    63                                                         <?php endif; ?>
    64                                                 </div><!-- .attachment -->
    65                                         </div><!-- .entry-attachment -->
    66 
    67                                         <?php if ( ! empty( $post->post_content ) ) : ?>
    68                                         <div class="entry-description">
    69                                                 <?php the_content(); ?>
    70                                                 <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?>
    71                                         </div><!-- .entry-description -->
    72                                         <?php endif; ?>
    73 
    74                                 </div><!-- .entry-content -->
    75                         </article><!-- #post -->
    76 
    77                         <?php comments_template(); ?>
     16
     17                        <?php
     18              // Start the Loop.
     19              while ( have_posts() ) : the_post();
     20                  ?>
     21
     22                                <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
     23                                        <header class="entry-header">
     24                                                <h1 class="entry-title"><?php the_title(); ?></h1>
     25
     26                                                <div class="entry-meta">
     27                                                        <?php
     28                                                                $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
     29                                                                $post_title = get_the_title( $post->post_parent );
     30                                                                if ( empty( $post_title ) || 0 == $post->post_parent )
     31                                                                        $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
     32
     33                                                                printf( $published_text,
     34                                                                        esc_attr( get_the_date( 'c' ) ),
     35                                                                        esc_html( get_the_date() ),
     36                                                                        esc_url( get_permalink( $post->post_parent ) ),
     37                                                                        esc_attr( strip_tags( $post_title ) ),
     38                                                                        $post_title
     39                                                                );
     40
     41                                                                $metadata = wp_get_attachment_metadata();
     42                                                                printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
     43                                                                        esc_url( wp_get_attachment_url() ),
     44                                                                        esc_attr__( 'Link to full-size image', 'twentythirteen' ),
     45                                                                        __( 'Full resolution', 'twentythirteen' ),
     46                                                                        $metadata['width'],
     47                                                                        $metadata['height']
     48                                                                );
     49
     50                                                                edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
     51                                                        ?>
     52                                                </div><!-- .entry-meta -->
     53                                        </header><!-- .entry-header -->
     54
     55                                        <div class="entry-content">
     56                                                <nav id="image-navigation" class="navigation image-navigation" role="navigation">
     57                                                        <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
     58                                                        <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
     59                                                </nav><!-- #image-navigation -->
     60
     61                                                <div class="entry-attachment">
     62                                                        <div class="attachment">
     63                                                                <?php twentythirteen_the_attached_image(); ?>
     64
     65                                                                <?php if ( has_excerpt() ) : ?>
     66                                                                <div class="entry-caption">
     67                                                                        <?php the_excerpt(); ?>
     68                                                                </div>
     69                                                                <?php endif; ?>
     70                                                        </div><!-- .attachment -->
     71                                                </div><!-- .entry-attachment -->
     72
     73                                                <?php if ( ! empty( $post->post_content ) ) : ?>
     74                                                <div class="entry-description">
     75                                                        <?php the_content(); ?>
     76                                                        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?>
     77                                                </div><!-- .entry-description -->
     78                                                <?php endif; ?>
     79
     80                                        </div><!-- .entry-content -->
     81                                </article><!-- #post -->
     82
     83                                <?php comments_template(); ?>
     84                               
     85                        <?php endwhile; // end of the loop. ?>
    7886
    7987                </div><!-- #content -->
    8088        </div><!-- #primary -->