Temanızın functions.php dosyasını açın ve en altına ekleyin...
// Urunlerin one cikan fotograflarini gizle ve ikinciyi goster
add_action('woocommerce_init', 'replace_loop_product_thumbnail');
function replace_loop_product_thumbnail()
{
remove_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail',10);
function replace_product_thumbnail()
{
global $product;
$attachment_id = $product->get_gallery_attachment_ids()[0];
echo "<img src='" . wp_get_attachment_url( $attachment_id ) . "'>";
}
add_action('woocommerce_before_shop_loop_item_title', 'replace_product_thumbnail', 10);
}
add_filter('woocommerce_single_product_image_thumbnail_html', 'hide_thumbnails_except_featured_image', 99, 2);
function hide_thumbnails_except_featured_image($html, $attachment_id)
{
global $product;
$new_html = '';
$featuted_image_id = $product->get_image_id();
if ($featuted_image_id != $attachment_id)
{
$new_html = $html;
}
return $new_html;
}Kaydedin, site bellek tutuyorsa önbelleği temizleyin ve kontrol edin.
cevap için çok teşekkür ederim. söylediğiniz gibi yaptım ama şöyle bir durum oldu. öne çıkan fotoğraflar görünmeye devam ediyor altlarında ise galerideki birinci fotoğraf var. ekleyeceğim görseldeki gibi