删除Woocommerce产品的LinkUrl到图像 [英] Remove LinkUrl to Image for Woocommerce Products

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

问题描述

我正试图取消在woocommerce产品特色图像中单击图像的功能,以使您无法再单击该图像并将其放大.

I am trying to remove the ability to click on an image in woocommerce's product featured images, so that you can no longer click on the image and make it bigger.

关于CSS的技能不多,因此请您进行简单的解释. 我打开了product-image.php,我知道如何在主题中输入自定义代码.

Not much skills with css so simple explanations are appreciated. I have the product-image.php open and I know how to enter custom code into my theme.

有人吗?

推荐答案

product-image.php

echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image ), $post->ID );

echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image ), $post->ID );

,然后在product-thumbnails.php文件中更改

echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a href="%s" class="%s" title="%s" data-rel="prettyPhoto[product-gallery]">%s</a>', $image_link, $image_class, $image_title, $image ), $attachment_id, $post->ID, $image_class );

echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a title="%s">%s</a>', $image_title, $image ), $attachment_id, $post->ID, $image_class );

执行上述操作应删除单击图像并将其放大的功能.

Doing the above should remove the ability to click on the image and make it bigger.

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

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