I’ve just added a new custom field, called Country of Origin, I’ve been able to use the following in my functions.php file to call the country of origin below each product on the shop page. It works fine, the only issue is I can’t get the actual the_field(‘country_of_origin’) wrapped in a div with a specific CSS class attached to it, so that I can style it. Not sure what the best way to move forward with this would be as I’m fairly new to php.
/ Add ACF Info to Product on Shop page
add_action( 'woocommerce_after_shop_loop_item_title', "ACF_product_content", 10 );
echo ‘Country of Origin:
Edit: Figured it out, was such an easy fix, can’t believe I didn’t think of it before!!
Just had to echo <divs> around the_field()
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users