Shopify Developer Guide – Display a blog loop on the homepage of a shopify store

Here we have a simple way to display a blog on the homepage of a Shopify store – depending on your html markup and css – it could look something like this:

shopify developer blog loop on homepage

Here is the code in a gist I’ve used to output this blog on a custom Shopify theme.

I’ve commented the code so things should make sense to any experienced designer or developer.

It’s important to note that you will need to add your own HTML markup to display this nicely on your Shopify store. This is a raw, bare-bones solution.

Notice I’m setting limit to 2 posts and it’s from the default “news” blog.

If there’s a featured image for the post we’ll use that – else we’ll use the first image of the post.