creative designer

There's going to be times when you want to show a list of the most recents articles (posts) from all your Shopify Blogs combined - not just pulling the latest ones from a single Blog. Since I saw the question pop up on the ecommerce forums again, I grabbed a vodka and wrote some code. Yes, these are the sort of things I fill my evenings with...

This relates a little bit to an earlier article about How to join Shopify arrays using the undocumented concat filter. Now when I say undocumented, don't got thinking this is some magical insider hot tip. It just doesn't appear in the Shopify Documentation, but does appear in some public Shopify GitHub files. Since it is undocumented there's always the chance that this filter might stop working without notice so proceed at your own risk. 

"No more boring typing Jason, let's see the code."

(No more talking in the third person either perhaps)

I've made a gist that has the code for showing recent articles from all blogs so jump to that link for some copy and paste action. You could also just read the embedded version below. Comments have been added in to explain some of the parts so I don't think a step by step guide is needed. If it's all too vague please post a comment (or let me know somehow - like twitter) and I'll jump back in and update it.

"Did you test this code?"

Nope. Late night rambling rules prohibit me from testing. There could be typos or all sorts of madness in that file.

 

"This concat thing scares me. Is there other ways?"

Of course! Rather than reinventing the wheel here it will be far easier to link to this sweet bit of code from @NathanPJF on GitHub. This shows how to grab the latest post from each blog and show it, in a few different ways. @NathanPJF also does a much finer job of being verbose with his explanation. You never know what you're going to get with mine!

Like to work with me?

Let's talk