Solved: Multiple where statements

Hi :slight_smile:

Is it possible to do more than one where statement?

I’m wanting to get the 3 latest posts excluding the “current” one to show as a “more posts” kind of section.

{{ range first 3 (where .Site.Pages.ByDate.Reverse "Section" "posts" where ".Title" "!=" .Title) }}
  <!-- latest posts -->
{{ end }}
1 Like

Try this:

{{ range first 3 (where (where .Site.Pages.ByDate.Reverse "Section" "posts") ".Title" "!=" .Title) }}
  <!-- latest posts -->
{{ end }}
8 Likes

That worked perfectly @moorereason

Thank you so much!