PATselov
Новичок

Имеем фильтр woocommerce
<div class="thumbnails"><?php
$cls = get_body_class();
$count = 4;
if (in_array("both-sidebars", $cls)) {
$count = 5;
}
$loop = 0;
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', $count );
foreach ( $attachment_ids as $attachment_id ) {
$classes = array( 'zoom' );
if ( $loop == 0 || $loop % $columns == 0 )
$classes[] = 'first';
if ( ( $loop + 1 ) % $columns == 0 )
$classes[] = 'last';
$image_link = wp_get_attachment_url( $attachment_id );
if ( ! $image_link )
continue;
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'full' ) );
$image_class = esc_attr( implode( ' ', $classes ) );
$image_title = esc_attr( get_the_title( $attachment_id ) );
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 );
$loop++;
}
?><div class="clear"></div></div>
И в файле CSS
img {
width: auto\9;
height: auto;
max-width: 100%;
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
Как правильно изменить или дописать условие чтоб вместо max-width: 100%; было 50% но только для блока <div class="thumbnails"> ?
<div class="thumbnails"><?php
$cls = get_body_class();
$count = 4;
if (in_array("both-sidebars", $cls)) {
$count = 5;
}
$loop = 0;
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', $count );
foreach ( $attachment_ids as $attachment_id ) {
$classes = array( 'zoom' );
if ( $loop == 0 || $loop % $columns == 0 )
$classes[] = 'first';
if ( ( $loop + 1 ) % $columns == 0 )
$classes[] = 'last';
$image_link = wp_get_attachment_url( $attachment_id );
if ( ! $image_link )
continue;
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'full' ) );
$image_class = esc_attr( implode( ' ', $classes ) );
$image_title = esc_attr( get_the_title( $attachment_id ) );
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 );
$loop++;
}
?><div class="clear"></div></div>
И в файле CSS
img {
width: auto\9;
height: auto;
max-width: 100%;
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
Как правильно изменить или дописать условие чтоб вместо max-width: 100%; было 50% но только для блока <div class="thumbnails"> ?