Enable lightbox function of WooCommerce in WordPress ThemessteemCreated with Sketch.

There are some WordPress themes on the market that do not support WooCommerce. If you still want to use these themes with WooCommerce, then some of the features of WooCommerce are not directly accessible.

For example, if you want to activate or integrate the lightbox function of WooCommerce in such a theme, you have to insert the following code into the functions.php.

Here is the link to the code in my Gist account on GitHub, where you can find the code:

https://gist.github.com/Perun/524dd5d6fef518f85bc5bcae57c99361

Just include this code in the functions.php of the active theme:

add_action( 'after_setup_theme', 'name_of_theme' );

function name_of_theme() {
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
}

The name_of_theme must be replaced by the name of the active theme. If you only need the Lightbox-function and not the zoom and the slider, just add_theme_support (' wc-product-gallery-lightbox');.



Open Source Contribution posted via Utopian.io

Sort:  

Hey @vladimir-simovic I am @utopian-io. I have just super-voted you at 26% Power!

Suggestions https://utopian.io/rules

  • Your contribution is less informative than others in this category.
  • Utopian has detected 1 bot votes. I am the only bot you should love!!

Achievements

  • I am a bot...I love developers... <3
  • You have less than 500 followers. Just gave you a gift ;)
  • Seems like you contribute quite often. AMAZING!
    Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

[utopian-moderator]

upvote and resteem ^^

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 62567.98
ETH 2460.02
USDT 1.00
SBD 2.62