Getting first x post of a specific category

Hi there,

I was wondering if anyone can help me with a range statement.

What i want to achieve is that I want to display the first 2 posts of the “blog” section, where the category is either “a” or “b”.

I tried using:
{{ range first 2 where (where .Site.RegularPages) “.Params.categories” “in” “a”}}

but that didn’t work. Thanks

1 Like