Dori, over at
Backup Brain recently posed a question that has made its round through the board on previous occasions.
We didn't have an answer before -- but we do now.
The question: How can I set my blog to post entries from a last n amount of non-consecutive days.
Here's how to do it:
Your archiving method should be set at daily and your index would basically be an archive limited to the last seven days of posts.
A little more detail:
1. If you don't already have daily archiving turned on, turn it on
2. Instead of using just
CODE
<MTEntries>
...
</MTEntries>
which is the usual way to list entries in an index template, you would use
CODE
<MTArchiveList archive_type="Daily" lastn="7">
<MTEntries>
...
</MTEntries>
</MTArchiveList>
In other words, wrap your <MTEntries>...</MTEntries> in the <MTArchiveList> tag, which has the effect of listing the last 7 days worth of archives--and for each day of archives, then displays all of the entries from that day.
As for the reason why it's a bit hacky to do this: we currently don't support non-consecutive days in <MTEntries> because there isn't a fast way of looking up "the last N days with posts on them". There is a fast way of looking up "the last N days" and "the last N posts", so that is why we have always supported those.
In fact, the method used above is basically just as fast (in terms of system processing) as using a built-in non-consecutive days would be--in either case, the system needs to iterate through the entries in the DB until it finds N days worth of posts (== N daily archives).