Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/attachment.php

    r15226 r14936  
    77 * @since Twenty Ten 1.0
    88 */
     9?>
    910
    10 get_header(); ?>
     11<?php get_header(); ?>
    1112
    1213        <div id="container">
     
    6869    }
    6970    $k++;
    70     // If there is more than 1 image attachment in a gallery
    71     if ( count( $attachments ) > 1 ) {
    72         if ( isset( $attachments[ $k ] ) )
    73             // get the URL of the next image attachment
    74             $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    75         else
    76             // or get the URL of the first image attachment
    77             $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
    78     } else {
    79         // or, if there's only 1 image attachment, get the URL of the image
    80         $next_attachment_url = wp_get_attachment_url();
    81     }
     71    if ( isset( $attachments[ $k ] ) )
     72        $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
     73    else
     74        $next_attachment_url = get_permalink( $post->post_parent );
    8275?>
    8376                        <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
Note: See TracChangeset for help on using the changeset viewer.