1

I'm currently developing my own theme in WooCommerce, it's a great way to get familiar with it, and a rather fantastic plugin...

I worked on a lot of aspects, including carts, but now, I'm attacking the product page and I wanted to activate the zoom capability that comes with WooCommerce.

So I added this in my function.php page, as to test everything (sinope's being my theme's name):

function sinope_setup() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}
add_action( 'after_setup_theme', 'sinope_setup' );

Now, I can tell it adds empty html code at the end of my theme:

Empty Code

But worse, the images do show, but only as href links, no zoom effect whatsoever:

Zoom not working

What am I missing?

If I activate the TwentySeventeen theme, of course, all is fine and zoom is OK.

  • are you getting js errors? – inarilo Sep 7 '17 at 15:58
  • None :( It's good news, my code is tight. But no errors. – Mehdi Bouhalassa Sep 7 '17 at 16:08
  • what happens if you just put those lines directly into functions.php? – inarilo Sep 7 '17 at 21:34
  • What lines, these? function sinope_setup() { add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } add_action( 'after_setup_theme', 'sinope_setup' ); Nothing at all. It just generates those empty HTML tags that are, clearly, the content of the gallery but without the actual images. – Mehdi Bouhalassa Sep 8 '17 at 12:59
  • what about image sizes? do you have to specify different sizes for it to work? – inarilo Sep 8 '17 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.