Showing metafields on collection page in Craft

We are using the theme Craft and would like one of our metafields to appear on the collection page, between the title and price on each product. Is there somewhere in the code where I can add the metafield to make this happen?

Hello @theengravers :waving_hand:

To insert metafield of the collection, you can use this code

{{ collection.metafields['namespace']['key'] | metafield_tag }}

Make sure to replace namespace and key correctly. Hope that helps!

Thank you @ZenoPageBuilder ! Where in the code do I add it?

Hi @theengravers

It depends on your theme code. You should find in the file product.liquid, or product.json, or product-template.liquid (and other variations). Look for the line which shows the product title, and paste the code under it. Because I don’t know how your theme code look, can cannot tell exactly. You can try, if you still need help, you can send those file code here and I can help further.

@ZenoPageBuilder Would I not need to add it to one of the collection codes, rather than the product ones? I’m confused as the metafields already appear on the product pages, but not on the collections.

Sorry @theengravers , I was wrong, it is about collection not product, so you should paste it in main-collection-product-grid.liquid