Merge pull request #14937 from woocommerce/fix/gallery-noscript-and-alignment

Gallery fixes
This commit is contained in:
Claudio Sanches 2017-05-08 14:45:41 -03:00 committed by GitHub
commit e92b93f992
8 changed files with 25 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -388,6 +388,10 @@ table.variations {
cursor: pointer;
}
li:nth-child(4n+1) {
clear: left;
}
img {
opacity: .5;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -245,6 +245,10 @@ p.demo_store,
}
}
}
li:nth-child(4n+1) {
clear: left;
}
}
}

View File

@ -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];

View File

@ -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.
*