Ticket #23649: 23649.diff
File 23649.diff, 1.7 KB (added by , 12 years ago) |
---|
-
wp-content/themes/twentythirteen/style.css
1511 1511 width: auto; 1512 1512 } 1513 1513 1514 .blog .format-gallery .gallery-item .portrait img, 1515 .archive .format-gallery .gallery-item .portrait img, 1516 .search .format-gallery .gallery-item .portrait img { 1517 height: auto; 1518 max-height: 1000%; 1519 max-width: 148px; 1520 width: 100%; 1521 } 1522 1514 1523 .blog .format-gallery .gallery-item:first-child, 1515 1524 .archive .format-gallery .gallery-item:first-child, 1516 1525 .search .format-gallery .gallery-item:first-child { -
wp-content/themes/twentythirteen/functions.php
486 486 endif; 487 487 488 488 /** 489 * Adds a class to the attachment link so portrait images can be displayed 490 * correctly in the featured gallery. 491 * 492 * @since Twenty Thirteen 1.0 493 * 494 * @param string $link Attachment link 495 * @param int $id Attachment ID 496 * @return string 497 */ 498 function twentythirteen_get_attachment_link( $link, $id ) { 499 500 if ( has_post_format( 'gallery' ) && ! is_single() ) { 501 $image = wp_get_attachment_metadata( $id ); 502 if ( $image['height'] > $image['width'] ) 503 $link = str_replace( '<a ', '<a class="portrait" ', $link ); 504 } 505 506 return $link; 507 } 508 add_filter( 'wp_get_attachment_link', 'twentythirteen_get_attachment_link', 10, 2 ); 509 510 /** 489 511 * Extends the default WordPress body class to denote: 490 512 * 1. Custom fonts enabled. 491 513 * 2. Single or multiple authors.