我正在使用Woocommerce创建一个1800多种产品的电子商店。Woocommerce附带了一个内置的PrettyTo灯箱插件。默认情况下,当您单击在lightbox中缩放图像时,它会加载原始Wordpress图像大小。
Woocommerce在模板“产品图像”中调用此原始图像。php’。我可以修改那个。变量$image\\u link调用原始大小。我想打电话给一个我已经做过的定制尺寸。我只是不知道怎么称呼它,我已经在文档、论坛和网站上找了一天多了,但都找不到。
I need to modify $image_link so that it calls my custom image size (that I added via add_image_size). But how? I know this is Wordpress basics but I\'m unable to get it done...
我的站点示例(单击可缩放,它显示一幅宽1600px的缩小图像,但我想要一幅更小的图像):
http://www.affichesmarci.com/shop/the-railys-cycling-act/ <?php
if ( has_post_thumbnail() ) {
$image = get_the_post_thumbnail( $post->ID, apply_filters( \'single_product_large_thumbnail_size\', \'shop_single\' ) );
$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
$image_link = wp_get_attachment_url( get_post_thumbnail_id() );
$attachment_count = count( $product->get_gallery_attachment_ids() );
if ( $attachment_count > 0 ) {
$gallery = \'[product-gallery]\';
} else {
$gallery = \'\';
}
echo apply_filters( \'woocommerce_single_product_image_html\', sprintf( \'<a href="%s" itemprop="image" class="bigbox woocommerce-main-image zoom" title="%s" rel="prettyPhoto\' . $gallery . \'">%s</a>\', $image_link, $image_title, $image ), $post->ID );
} else {
echo apply_filters( \'woocommerce_single_product_image_html\', sprintf( \'<img src="%s" alt="Placeholder" class="bigbox" />\', woocommerce_placeholder_img_src() ), $post->ID );
}
?>
<?php do_action( \'woocommerce_product_thumbnails\' ); ?>