2014-11-07 3 views
0

나는이 스레드 Woocommerce: Featured image different than product image에서 영감을 얻어 Woocommerce 테마 웹 사이트의 제품 페이지에서 추천 이미지/큰 이미지로 갤러리 페이지 중 하나를 만들었습니다.woocommerce 제품 페이지의 이미지 크기 변경

그러나 미리보기 이미지 갤러리에서 작은 이미지를 선택하기 때문에 치수가 변경되지 않고 이미지가 흐리게 표시됩니다. HTML이 그것을 제한하고 있습니다. 제품 단일 페이지에서 주 이미지/큰 이미지의 폭과 높이를 늘리려면 어떻게해야합니까?

참조 용으로이 링크 http://fliptales2.davcommdev.com/product/aaron-camel/을 방문 할 수 있습니다. 이미지가 흐릿하고 큰 이미지의 HTML이 200x159임을 알 수 있습니다.

답변

0

어쨌든 완료되었습니다. 여기에 코드가 있습니다. (참조 : Woocommerce: Featured image different than product image)

<div class="images"> 

<?php 

    $attachment_ids = $product->get_gallery_attachment_ids(); 
    isset ($placeholder_width)? : $placeholder_width=0; 
    isset ($placeholder_height)? : $placeholder_height=0; 

    if ($attachment_ids) { 
     $attachment_id = $attachment_ids[0]; 

    if (! $placeholder_width) 
     $placeholder_width = $woocommerce->get_image_size('shop_catalog_image_width'); 
    if (! $placeholder_height) 
     $placeholder_height = $woocommerce->get_image_size('shop_catalog_image_height'); 

     $output = '<div class="imagewrapper">'; 

     //$classes = array('imagewrapper'); 
     $classes = array(); 
     $image_link = wp_get_attachment_url($attachment_id); 

     if ($image_link) { 

     $image  = wp_get_attachment_image($attachment_id, apply_filters('single_product_large_thumbnail_size', 'shop_single')); 
     $image_class = esc_attr(implode(' ', $classes)); 
     $image_title = esc_attr(get_the_title($attachment_id)); 

     echo apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" rel="prettyPhoto[product-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" />', woocommerce_placeholder_img_src()), $post->ID); 

     } 

    } 
?> 

<?php do_action('woocommerce_product_thumbnails'); ?> 
관련 문제