diff --git a/wp-content/themes/twentytwelve/archive.php b/wp-content/themes/twentytwelve/archive.php index 210eaca7c3..8bfb01c903 100644 --- a/wp-content/themes/twentytwelve/archive.php +++ b/wp-content/themes/twentytwelve/archive.php @@ -6,7 +6,8 @@ * For example, puts together date-based pages if no date.php file exists. * * If you'd like to further customize these archive views, you may create a - * new template file for each specific one, like tag.php for Tag archives or + * new template file for each specific one. For example, Twenty Twelve already + * has tag.php for Tag archives, category.php for Category archives, and * author.php for Author archives. * * Learn more: http://codex.wordpress.org/Template_Hierarchy @@ -24,35 +25,16 @@ get_header(); ?>

' . get_the_date() . '' ); - } elseif ( is_month() ) { + elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '' ); - } elseif ( is_year() ) { + elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '' ); - } elseif ( is_tag() ) { - printf( __( 'Tag Archives: %s', 'twentytwelve' ), '' . single_tag_title( '', false ) . '' ); - } elseif ( is_category() ) { - printf( __( 'Category Archives: %s', 'twentytwelve' ), '' . single_cat_title( '', false ) . '' ); - } else { + else : _e( 'Archives', 'twentytwelve' ); - } + endif; ?>

- - ' . $tag_description . ''; - } - // Show an optional category description. - if ( is_category() ) { - $category_description = category_description(); - if ( $category_description ) - echo '
' . $category_description . '
'; - } - ?>
+ +
+
+ + +
+

' . single_cat_title( '', false ) . '' ); ?>

+ + +
+ +
+ + + + + + + +
+
+ + + \ No newline at end of file diff --git a/wp-content/themes/twentytwelve/image.php b/wp-content/themes/twentytwelve/image.php index b3dc75c630..c84cc510cc 100644 --- a/wp-content/themes/twentytwelve/image.php +++ b/wp-content/themes/twentytwelve/image.php @@ -2,6 +2,8 @@ /** * The template for displaying image attachments. * + * Learn more: http://codex.wordpress.org/Template_Hierarchy + * * @package WordPress * @subpackage Twenty_Twelve * @since Twenty Twelve 1.0 @@ -51,23 +53,25 @@ get_header(); ?> * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file */ $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); -foreach ( $attachments as $k => $attachment ) { +foreach ( $attachments as $k => $attachment ) : if ( $attachment->ID == $post->ID ) break; -} +endforeach; + $k++; // If there is more than 1 attachment in a gallery -if ( count( $attachments ) > 1 ) { - if ( isset( $attachments[ $k ] ) ) +if ( count( $attachments ) > 1 ) : + if ( isset( $attachments[ $k ] ) ) : // get the URL of the next image attachment $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); - else + else : // or get the URL of the first image attachment $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); -} else { + endif; +else : // or, if there's only 1 image, get the URL of the image $next_attachment_url = wp_get_attachment_url(); -} +endif; ?> + +
+
+ + +
+

' . single_tag_title( '', false ) . '' ); ?>

+ + +
+ + +
+ + + + + + + +
+
+ + + \ No newline at end of file