the goal: add class to woocommerce single product template gallery thumbnails if media attachment ACF field toggled (true/false)
i have the following custom field (quick_ship):
i’ve added this in functions but not working at the moment:
<?php
$image = get_field('quick_ship');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $image ) {
echo wp_get_attachment_image( $image, $size, array ('class' => 'quick-ship' ) );
}
thanks for any help.
You are missing the 3rd argument $icon
echo wp_get_attachment_image( $image, $size, false, array ('class' => 'quick-ship' ) );