无法删除WooCommerce的图像缩放 [英] Can't remove WooCommerce's image zoom

查看:60
本文介绍了无法删除WooCommerce的图像缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从使用WooCommerce的自定义主题网站中删除图像缩放.这是我尝试在我的functions.php文件中添加的内容:

I am trying to remove the image zoom from my custom themed website which uses WooCommerce. Here is what I've tried adding in my functions.php file:

add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 );

function remove_pgz_theme_support() {
    remove_theme_support( 'wc-product-gallery-zoom' );
}

还有这个

add_action( 'wp', 'remove_pgz_theme_support', 20 );

function remove_pgz_theme_support() {
    remove_theme_support( 'wc-product-gallery-zoom' );
}

我花了一些时间进行谷歌搜索,但答案总是建议按照上述方法尝试一些操作.

I've spend some time googling but the answers always recommend trying something along the lines of the above.

推荐答案

对我有用的解决方案是在您的functions.php文件中添加以下内容

The solution that worked for me is adding the following to your functions.php file

// Add WooCommerce support
function add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

add_action( 'after_setup_theme', 'add_woocommerce_support' );

这篇关于无法删除WooCommerce的图像缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆