Ticket #23649: 23649.1.diff
File 23649.1.diff, 1.8 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentythirteen/style.css
1516 1516 .search .format-gallery .gallery-item img { 1517 1517 height: 100%; 1518 1518 max-height: 148px; 1519 max-width: 1000%;1519 max-width: none; 1520 1520 width: auto; 1521 1521 } 1522 1522 1523 .blog .format-gallery .gallery-item .portrait img, 1524 .archive .format-gallery .gallery-item .portrait img, 1525 .search .format-gallery .gallery-item .portrait img { 1526 height: auto; 1527 max-height: none; 1528 max-width: 148px; 1529 width: 100%; 1530 } 1531 1523 1532 .blog .format-gallery .gallery-item:first-child, 1524 1533 .archive .format-gallery .gallery-item:first-child, 1525 1534 .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.