DEV Community

Muhammad Shoaib
Muhammad Shoaib

Posted on • Edited on

How to access Shopify Blog object in different pages?

Since Shopify lets your store have multiple blogs, you have to target the specific handle of your blog in the liquid code.

Change the code from:

{% for article in blog.articles %}

to include the handle of your blog:

{% for article in blogs.news.articles %}

If you want to fetch blogs by categories, just repalce news handle by your category name example below

{% for article in blogs.fashion.articles %}

In above example fashion is your category name.

Top comments (0)