Archived topic
WooCommerce 3.0 Missing Lightbox
26 replies · Started by Jay on April 17, 2017
Read the thread here on the support forum for the issue with the Lightbox disappearance and see that you are adding the code to an upcoming update...but is there an easy fix in the meantime? Could you add the WooCommerce Code...
add_action( 'after_setup_theme', 'yourtheme_setup' );
function yourtheme_setup() {
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
to the Hooks add of GP Premium? Or does it have to be added specifically to the "If you’re managing your own WooCommerce theme you simply need to add a few lines to your after_setup_theme action. (most likely in your functions.php file)."
Cheers,
Jay Goodrich
Hi Jay,
The easiest way in the mean time is to add this code:
https://gist.github.com/generatepress/0d81e87b1ec4494023121f3ecc753ccd
using this method:
https://docs.generatepress.com/article/adding-php/#code-snippets
Let me know if this helps.
Nice Leo!
Added the Code Snippets plugin and pasted your code from GitHub...works perfectly. That's great little tool to know about. Thank you!
Cheers,
Jay Goodrich
Glad I could help!
Hallo,
I had the same problem.
Using Code Snippets and your following code it works now:
add_action( 'after_setup_theme','tu_woocommerce_gallery' );
function tu_woocommerce_gallery() {
// Add support for WC features
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
THX for the help!!
I tried also the revision, but there was a problem:
"The code snippet you are trying to save produced a fatal error on line 2: syntax error, unexpected 'tu_woocommerce_gallery' (T_STRING), expecting '('
I can not evaluate this - may be I made a mistake.
Greatings from Germany
Key
Hi Key,
Are you still having problem with this?
oha - i just tried the revision again. now the site is down: error 500

what must i do now? deactivate the code snippet plugin via ftp?
Yup that should work, or go in and fix/delete the code with error.
i deinstalled the plugin via ftp now, and then the frot- and backend runs.
when i install now code snippets again, the side is down like before.
hallo leo and tom,
do you have an idea what i can do, that the code snippets plugin can be activated again? at the moment the site goes down like after installing the revision code. there must be anywhere remains even after deleting and new installing code snippets.
Check out the FAQs here: https://en-ca.wordpress.org/plugins/code-snippets/
The "Help! I just activated a snippet, and my whole site broke!" question should help you.
Then you can delete that snippet completely.
thx for the hint!
i did it like described, and now code snippets runs again without problems.
i installed the code (not the revision) and that works, but with some differences to storefront.
do you know, when you update GeneratePress for WC 3.0?
The update should be coming soon :)
The update contains that exact piece of code though - all it should do is enable lightbox/gallery features, nothing else.
Hi
I tried all of them and added the code to GP child-theme Functions.php, but non of them is working for me.