Is there a way of displaying an entry twice depending on postDate and a custom field date in one loop? I'm building a feed of entries mixed from different sections. One section contains a postDate and a custom field date called releaseDate. I want these entries to appear in the feed with their postDate, but when the releaseDate is equivalent to now I want the entry to return in the feed in order of appearance. Is this possible?

I've tried something like this:

craft.entries.section(['section1', 'section2']).order(['postDate DESC', 'releaseDate DESC'])
You could probably do this purely from Twig / a template, but I think it's going to end up being much easier from a plugin / PHP.

The general gist of it would be:


Grab all entries from section 1 ordered by postDate.
Grab all entries from section 2 ordered by releaseDate.
Create a new array and loop through 1 and 2 inserting via your custom sorting logic.
Return that new sorted array back to the template.