Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1021 from linuxbastard/woo-3-compatibility
Browse files Browse the repository at this point in the history
Woo 3 compatibility
  • Loading branch information
olefredrik authored Aug 5, 2017
2 parents dfed1b6 + d61cbba commit 89f6c92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ npm-debug.log
dist
*.sass-cache*
*.log
.idea/
*.swp

6 changes: 4 additions & 2 deletions library/responsive-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function foundationpress_adjust_image_sizes_attr( $sizes, $size ) {

// Remove inline width and height attributes for post thumbnails
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', '', $html );
return $html;
if(!strpos($html, 'attachment-shop_single')) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', '', $html );
}
return $html;
}
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
4 changes: 4 additions & 0 deletions library/theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function foundationpress_theme_support() {

// Declare WooCommerce support per http://docs.woothemes.com/document/third-party-custom-theme-compatibility/
add_theme_support( 'woocommerce' );
// Additional theme support for woocommerce 3.0.+
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );

// Add foundation.css as editor style https://codex.wordpress.org/Editor_Style
add_editor_style( 'assets/stylesheets/foundation.css' );
Expand Down

0 comments on commit 89f6c92

Please sign in to comment.