Date Archives: Last 6 months From the Creating an Archive Page for Entries article in the Craft docs. How could I limit it so that it grouped by month but limited things to 6 months?:

{% set allEntries = craft.entries.section('blog').limit(null) %}
{% for date, entries in allEntries | group("postDate|date('F Y')") %}
    &lt;h2&gt;{{ date }}&lt;/h2&gt;
    &lt;ul&gt;
        {% for entry in entries %}
            &lt;li&gt;{{ entry.getLink() }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}
100% untested, but something like this should work using Twig's date_modify filter.

{% set startDate = now|date_modify("-6 months") %}

{% set allEntries = craft.entries.section('blog').limit(null).postDate('&gt;= ' ~ startDate) %}

{% for date, entries in allEntries | group("postDate|date('F Y')") %}
    &lt;h2&gt;{{ date }}&lt;/h2&gt;
    &lt;ul&gt;
        {% for entry in entries %}
            &lt;li&gt;{{ entry.getLink() }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}