In order to show only 4 posts I'm using the following snippet:
{% for post in site.categories.mycategory limit:4 %}
{{ post.content }}
{% endfor %}
Now, in a second container, I need to show posts from 5 to 8, then posts from 9 to 12 and so on. Is there a filter to range posts? Thanks.
You can use offset to skip the first elements:
{% for post in site.categories.mycategory limit:4 offset:4 %}
{{ post.content }}
{% endfor %}
Also consider pagination.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With