Skip to content

Commit

Permalink
Add noscript style for gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed May 8, 2017
1 parent bdd3eba commit af949b7
Showing 1 changed file with 12 additions and 0 deletions.
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 af949b7

Please sign in to comment.