Aroganz Aroganz - 1 month ago 11
CSS Question

Custom text label on Woocommerce shop thumbnail images

Am using a
Woocommerce theme for a online shop.

Where i do like to display some custom text on top of each thumbnail.
Something like the following example. I understand that i have to fiddle with the

archive-product.php
file. And also i need to style the same.

Can someone point me in the right direction. Also is it possible to accomplish the same via Advance Custom Field Plugin?

Answer

You should be able to accomplish this via ACF (Advanced Custom Fields). When you create the custom field you assign the post_type to a WooCommerce product.

Then in the products loop you just make use of ACF's get_field() to fetch it. Maybe you have to query the ID of each product and then insert it in ACF's function like this: get_field('my_text', 123); (id = 123).

Comments