So we have a custom Wordpress Pet Site in which we sort pet posts by the ACF field of litter_born and it all works fine until no posts show and then it will just throw a page error. Here is the code we are using:
{% for post in posts | sort((a, b) => b.litter_born <=> a.litter_born) %}
//pulling in post data
{% endfor %}
Which works fine until no posts show then it throws and error:
