我正在使用WooCommerce在WordPress平台下创建我的电子商务商店,但我只想为登录用户显示归档商店页面图像。
非登录用户将看到占位符,阻止他们看到商店的图像。
我遵循了教程,这似乎是我想要的,但没有视觉结果一致,我相信这个钩子不是无关的,也不是被反对的。
//Display different images for non-logged in users
add_filter( 'woocommerce_placeholder_img_src', 'growdev_custom_woocommerce_placeholder', 10 );
fun
下面你会看到,我正在尝试添加一个40%的width到我的图像,如果不是移动设备。然而,即使在桌面设备上,图像仍然显示出100%的宽度。您可以在这里查看此页面:
这是我正在使用的代码
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
// Any mobile device (phones or tablets).
if (!$detect->isMobile()) {
add_action('woocommerce_after_single_product_summary'
我在一个小项目上工作,需要使产品图像更小时,从移动视图看到。目前图像太大,彼此之间的间距(我有两个产品在一条线上)太小,所以我想使分离,以便客户可以获得更好的产品概述。
我尝试使用图像CSS,如下所示:
@media only screen and (max-width: 600px) {
.woocommerce ul.products li.product a img {
height:265px; //to make image smaller so can get more spacing between.
}
}
但这似乎使图像变小,但也切断了它,所以这是不好的。有没有人可
我有一个wordpress网站,在那里客户制作一个带有文本和图标的图像,一旦通过woocommerce处理并为该图像名称12345.png支付后保存为Customer_product_image
function add_order_item_meta($item_id, $values) {
$key = 'customer_product_image'; // Define your key here
$value = $values['user_img']; // Get your value here
woocommerce_ad