本文介绍了在WooCommerce的产品库下显示标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在产品页面画廊的缩略图下显示标题文本.我需要显示文字,因为图库中有很多图像,每个拇指都是引擎的一部分,并且名称可以帮助用户.

I'm trying to show the caption text under the thumbnail in the product page gallery. I need to show the text because there are a lot images in the gallery and each thumb is a part of an engine and the name help the user.

WooCommerce产品页面中画廊的代码为:

The code for the gallery in WooCommerce product page is:

echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<li data-thumb="%s">%s%s<a href="%s" class="%s lightbox" data-rel="ilightbox[product]" data-caption="%s" title="%s" alt="%s"><i class="fa-search-plus"></i></a></li>', $thumb_image, $image_html, $caption_html, $image_link, $image_class, $image_caption, $image_title, $image_alt ), $attachment_id, $post->ID, $image_class );`

如何编辑?还是有什么解决办法?谢谢

How can I edit it? Or, there is any solution?Thanks

推荐答案

请确保您了解sprint函数的工作方式.您可以使用块的css位置进行游戏.这可能是解决方案.

Make sure that you understand sprint function working way.You could play with css position of block. This could be solution.

sprintf( '<li data-thumb="%s">%s<span style="postition:...">%s</span><a href="%s" class="%s lightbox" data-rel="ilightbox[product]" data-caption="%s" title="%s" alt="%s"><i class="fa-search-plus"></i></a></li>', $thumb_image, $image_html, $caption_html, $image_link, $image_class, $image_caption, $image_title, $image_alt )

这篇关于在WooCommerce的产品库下显示标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 03:04