我试图删除图像缩放从我的自定义主题网站,其中使用WooCommerce。下面是我尝试在我的functions.php文件中添加的内容:
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' );
}我花了一些时间在谷歌上搜索,但答案总是建议尝试一些类似于上面这些内容的东西。
发布于 2018-06-07 10:10:03
对我有效的解决方案是在functions.php文件中添加以下内容
// Add WooCommerce support
function add_woocommerce_support() {
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'add_woocommerce_support' );发布于 2018-06-05 19:01:42
我禁用所有图像效果,包括:
add_action('wp', 'remove_woo_image_effects');
function remove_woo_image_effects() {
// this should be disable the gallery slider and lightbox
remove_theme_support('wc-product-gallery-lightbox');
remove_theme_support('wc-product-gallery-slider');
// this should be disable the zoom
remove_theme_support('wc-product-gallery-zoom');
}我从我的自定义主题中用DIVI和两个测试它。
用定制主题在这里检查过
https://stackoverflow.com/questions/50704326
复制相似问题