44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Single Product Thumbnails
|
|
*
|
|
* @author WooThemes
|
|
* @package WooCommerce/Templates
|
|
* @version 1.6.4
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
global $post, $product, $woocommerce;
|
|
?>
|
|
<div class="thumbnails"><?php
|
|
|
|
$attachment_ids = $product->get_gallery_attachment_ids();
|
|
|
|
if ( $attachment_ids ) {
|
|
|
|
$loop = 0;
|
|
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', 3 );
|
|
|
|
foreach ( $attachment_ids as $id ) {
|
|
|
|
$classes = array( 'zoom' );
|
|
|
|
if ( $loop == 0 || $loop % $columns == 0 )
|
|
$classes[] = 'first';
|
|
|
|
if ( ( $loop + 1 ) % $columns == 0 )
|
|
$classes[] = 'last';
|
|
|
|
$attachment_url = wp_get_attachment_url( $id );
|
|
|
|
if ( ! $attachment_url )
|
|
continue;
|
|
|
|
printf( '<a href="%s" title="%s" rel="thumbnails" class="%s">%s</a>', esc_attr( $attachment_url ), esc_attr( get_the_title( $id ) ), implode( ' ', $classes ), wp_get_attachment_image( $id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) ) );
|
|
|
|
$loop++;
|
|
}
|
|
|
|
}
|
|
?></div>
|