Iām using the following code to retrieve the 4 most recent posts from my blog and display them on the homepage, however it is displaying posts with published: false
and visible: false
set. Any suggestions on how to stop these showing up? Thanks
{% set blogs = page.find('/blog').children.order('date', 'desc').slice(0, 4) %}
{% include 'partials/blogGrid.html.twig' with { 'collection': blogs, 'offset': 0, 'limit': 4} %}
(Note: hidden posts do not display on the blog page.)