Skip to content

Commit

Permalink
Merge pull request woocommerce#14937 from woocommerce/fix/gallery-nos…
Browse files Browse the repository at this point in the history
…cript-and-alignment

Gallery fixes
  • Loading branch information
claudiosanches authored May 8, 2017
2 parents 1e2b62a + 3289bee commit e92b93f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/css/twenty-seventeen-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/twenty-seventeen.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/css/twenty-seventeen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ table.variations {
cursor: pointer;
}

li:nth-child(4n+1) {
clear: left;
}

img {
opacity: .5;

Expand Down
2 changes: 1 addition & 1 deletion assets/css/woocommerce-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/woocommerce.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/css/woocommerce.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ p.demo_store,
}
}
}

li:nth-child(4n+1) {
clear: left;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion includes/wc-product-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ function wc_get_product_attachment_props( $attachment_id = null, $product = fals
$props['alt'] = trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );

// Large version.
$src = wp_get_attachment_image_src( $attachment_id, 'large' );
$src = wp_get_attachment_image_src( $attachment_id, 'full' );
$props['full_src'] = $src[0];
$props['full_src_w'] = $src[1];
$props['full_src_h'] = $src[2];
Expand Down
12 changes: 12 additions & 0 deletions includes/wc-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ function wc_prevent_adjacent_posts_rel_link_wp_head() {
}
add_action( 'template_redirect', 'wc_prevent_adjacent_posts_rel_link_wp_head' );

/**
* Show the gallery if JS is disabled.
*
* @since 3.0.6
*/
function wc_gallery_noscript() {
?>
<noscript><style>.woocommerce-product-gallery{ opacity: 1 !important; }</style></noscript>
<?php
}
add_action( 'wp_head', 'wc_gallery_noscript' );

/**
* When the_post is called, put product data into a global.
*
Expand Down

0 comments on commit e92b93f

Please sign in to comment.