Add related products to your blog posts using Metafields in Shopify.
Like my article about linking products to other products using metafields in Shopify, this short article shows that we can use a similar approach to link to products from a blog post too.
We can make use of the same product reference metafields definition, this time against the blog posts instead of products.
Creating the definition
Head to the Settings -> Metafields section of your store admin. Here we can select the “Blog posts” part of the store to add a field to.
Then we can add a new definition.
Here we use the name “Related Products” and key “custom.related_products” which will work in the liquid snippet below.
Select the “Product reference” content type. Followed by the “List of products” if you want to be able to link multiple products from your blog post.