liquid
liquid copied to clipboard
Is this possible?
I have an array of posts, each of which have a category. I want to only display 3 posts from categories 1,2, or 3 (there's potentially unlimited categories). Is there any way to do this with core liquid?
I figure I could do this if there were for comparisons or limits on if statements.
use a for loop on the array with a limit https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#for-loops.
In future, this is not the place to ask questions, please use stackoverflow (http://stackoverflow.com/questions/tagged/liquid) or the shopify design forum (https://ecommerce.shopify.com/c/ecommerce-design)