Sort posts from more sections

On my homepage I’m usign pagination and I want to display posts from two section ordere by date. However, the order is kept within the sections but one older post from one section is above some younger posts from the other section. Here is the code I’m using:

{{ $paginator := .Paginate (where (where .Site.Pages "Section" "in" (slice "flash" "story") ) "IsPage" true) }}
{{ range $index, $element := .Paginator.Pages.ByDate.Reverse }}

On the 2nd line, try replacing .Paginator with the $paginator variable you declared (untested)

I’ve already tried what you suggest, but no post are displayed then, the page stays empty.

I would have to see your code to troubleshoot further.

But on my laptop, given this content structure:

├── content
│   ├── flash
│   │   ├──
│   │   └──
│   ├── nope
│   │   ├──
│   │   └──
│   └── story
│       ├──
│       └──

And this template code:

{{ $paginator := .Paginate (where (where .Site.Pages "Section" "in" (slice "flash" "story") ) "IsPage" true) }}

{{- range $index, $element := $paginator.Pages.ByDate.Reverse }}
  <li><a href="{{ .Permalink }}">{{ .Title }} -- {{ .Date }}</a></li>
{{- end }}

I get this output:

  <li><a href="">Story2 -- 2018-11-19 09:14:27 -0600 CST</a></li>
  <li><a href="">Story1 -- 2018-11-19 09:14:27 -0600 CST</a></li>
  <li><a href="">Flash2 -- 2018-11-19 09:14:27 -0600 CST</a></li>
  <li><a href="">Flash1 -- 2018-11-19 09:14:01 -0600 CST</a></li>

Thanks for trying to help realy appreaciate it.
Actually on the first page of the paginator the content is ordered by date correctly.
The issue is that on the second page of the paginatior is some younger content than the last one on the first page.

flash5 (2018-11-20)
flash4 (2018-11-19)
story1 (2018-08-15)

flash3 (2018-10-15)
flash2 (2018-10-03)
flash1 (2018-08-04)

I see. So, you will need to share your code for me to troubleshoot further.

If you can’t do that, then create a sample repo that reproduces your issue, then share that.

Okay I see the line you’re talking about now, but I’m not sure how to fix. Perhaps someone else more familiar with pagination can help you.

Actually I figured it out… by adding .ByDate.Reverse in the the first line (L4), where the paginator is created … thanks anyway for your help.