Home › Forums › General Issues › using same field for different purpose › Reply To: using same field for different purpose
I suspect you are using a third party addon called “Justified Image Grid”?
What your current code does is replace the image IDs that woocommerce uses to generate the gallery with IDs provided by an ACF field.
The “Justified Image Grid” field is a field that outputs different content. Even if you managed to get WooCommerce to use the images selected in that field you wouldn’t get the grid that I assume you’re after.
What you could try however:
//Remove the default product gallery entirely
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
//Output the justified image grid instead
add_action( 'woocommerce_before_single_product_summary', 'my_justified_image_grid', 20 );
function my_justified_image_grid() {
the_field('proimages');
}
I don’t know if this will work out-of-the-box.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.