Changeset 24029
- Timestamp:
- 04/18/2013 05:08:55 PM (13 years ago)
- Location:
- trunk/wp-content/themes/twentythirteen
- Files:
-
- 2 edited
-
content-gallery.php (modified) (1 diff)
-
functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentythirteen/content-gallery.php
r23680 r24029 25 25 <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> 26 26 <?php else : ?> 27 <?php t wentythirteen_featured_gallery(); ?>27 <?php the_post_format_gallery(); ?> 28 28 <?php endif; // is_single() ?> 29 29 </div><!-- .entry-content --> -
trunk/wp-content/themes/twentythirteen/functions.php
r24005 r24029 446 446 } 447 447 448 if ( ! function_exists( 'twentythirteen_featured_gallery' ) ) :449 /**450 * Displays first gallery from post content. Changes image size from thumbnail451 * to large, to display a larger first image.452 *453 * @since Twenty Thirteen 1.0454 *455 * @return void456 */457 function twentythirteen_featured_gallery() {458 $pattern = get_shortcode_regex();459 460 if ( preg_match( "/$pattern/s", get_the_content(), $match ) && 'gallery' == $match[2] ) {461 add_filter( 'shortcode_atts_gallery', 'twentythirteen_gallery_atts' );462 echo do_shortcode_tag( $match );463 }464 }465 endif;466 467 448 /** 468 449 * Sets the image size in featured galleries to large. 469 *470 * @see twentythirteen_featured_gallery()471 450 * 472 451 * @since Twenty Thirteen 1.0 … … 476 455 */ 477 456 function twentythirteen_gallery_atts( $atts ) { 478 $atts['size'] = 'large'; 457 if ( has_post_format( 'gallery' ) && ! is_single() ) 458 $atts['size'] = 'large'; 459 479 460 return $atts; 480 461 } 462 add_filter( 'shortcode_atts_gallery', 'twentythirteen_gallery_atts' ); 481 463 482 464 /**
Note: See TracChangeset
for help on using the changeset viewer.