Ticket #21230: 21230.diff
File 21230.diff, 6.0 KB (added by , 13 years ago) |
---|
-
wp-content/themes/twentytwelve/image.php
20 20 21 21 <footer class="entry-meta"> 22 22 <?php 23 $ metadata = wp_get_attachment_metadata();23 $twentytwelve_metadata = wp_get_attachment_metadata(); 24 24 printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', 'twentytwelve' ), 25 25 esc_attr( get_the_date( 'c' ) ), 26 26 esc_html( get_the_date() ), 27 27 esc_url( wp_get_attachment_url() ), 28 $ metadata['width'],29 $ metadata['height'],28 $twentytwelve_metadata['width'], 29 $twentytwelve_metadata['height'], 30 30 esc_url( get_permalink( $post->post_parent ) ), 31 31 esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ), 32 32 get_the_title( $post->post_parent ) … … 50 50 * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, 51 51 * 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 52 52 */ 53 $ 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' ) ) );54 foreach ( $ attachments as $k => $attachment ) {55 if ( $ attachment->ID == $post->ID )53 $twentytwelve_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' ) ) ); 54 foreach ( $twentytwelve_attachments as $twentytwelve_k => $twentytwelve_attachment ) { 55 if ( $twentytwelve_attachment->ID == $post->ID ) 56 56 break; 57 57 } 58 $ k++;58 $twentytwelve_k++; 59 59 // If there is more than 1 attachment in a gallery 60 if ( count( $ attachments ) > 1 ) {61 if ( isset( $ attachments[ $k ] ) )60 if ( count( $twentytwelve_attachments ) > 1 ) { 61 if ( isset( $twentytwelve_attachments[ $twentytwelve_k ] ) ) 62 62 // get the URL of the next image attachment 63 $ next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );63 $twentytwelve_next_attachment_url = get_attachment_link( $twentytwelve_attachments[ $twentytwelve_k ]->ID ); 64 64 else 65 65 // or get the URL of the first image attachment 66 $ next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );66 $twentytwelve_next_attachment_url = get_attachment_link( $twentytwelve_attachments[ 0 ]->ID ); 67 67 } else { 68 68 // or, if there's only 1 image, get the URL of the image 69 $ next_attachment_url = wp_get_attachment_url();69 $twentytwelve_next_attachment_url = wp_get_attachment_url(); 70 70 } 71 71 ?> 72 <a href="<?php echo esc_url( $ next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php73 $ attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );74 echo wp_get_attachment_image( $post->ID, $ attachment_size );72 <a href="<?php echo esc_url( $twentytwelve_next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php 73 $twentytwelve_attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) ); 74 echo wp_get_attachment_image( $post->ID, $twentytwelve_attachment_size ); 75 75 ?></a> 76 76 77 77 <?php if ( ! empty( $post->post_excerpt ) ) : ?> -
wp-content/themes/twentytwelve/functions.php
103 103 * JavaScript for handling navigation menus and the resized 104 104 * styles for small screen sizes. 105 105 */ 106 wp_enqueue_script( ' navigation', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130320', true );106 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130320', true ); 107 107 108 108 /** 109 109 * Load special font CSS file. … … 111 111 */ 112 112 $options = $twentytwelve_options->get_theme_options(); 113 113 if ( $options['enable_fonts'] ) 114 wp_enqueue_style( ' fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' );114 wp_enqueue_style( 'twentytwelve-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' ); 115 115 116 116 /** 117 117 * Load our main CSS file. -
wp-content/themes/twentytwelve/archive.php
30 30 // Show an optional tag description 31 31 $tag_description = tag_description(); 32 32 if ( $tag_description ) 33 echo apply_filters( 't ag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );33 echo apply_filters( 'twentytwelve_tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' ); 34 34 } elseif ( is_category() ) { 35 35 printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); 36 36 // Show an optional category description 37 37 $category_description = category_description(); 38 38 if ( $category_description ) 39 echo apply_filters( ' category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );39 echo apply_filters( 'twentytwelve_category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' ); 40 40 } else { 41 41 _e( 'Blog Archives', 'twentytwelve' ); 42 42 }