Archive page - only show posts from certain month Using this handy thing (http://buildwithcraft.com/help/entry-archive) to create an archive page, but not quite doing what I need it to do.

Set up as a route to call /year/month, replacing year with current year if not provided and replacing month with most recent month that has posts in it if not provided.

This version will print out all posts from a single year:

{% set entriesInYear = craft.entries.section('pressReleases').limit(null).after(year).before(year+1) %}

{% for entry in entriesInYear %}
    &lt;p&gt;{{ entry.title }}&lt;/p&gt;
{% endfor %}


And this version will print out the entire year into groups based on month:

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


But what I need is to only get the posts from the month in the url and am not sure how to get there... basically an entriesInMonth variable as opposed to an entriesInYear.
There's probably a cleaner way to go about this, but something like this should work:

{# These are probably coming from the querystring, but I'll hard code them here #}
{% set year = 2015 %}
{% set month = 'July' %}

{% set entriesInYear = craft.entries.section('news').limit(null).after(year).before(year+1) %}
{% set groupedEntries =  entriesInYear | group("postDate|date('F')") %}

&lt;h2&gt;{{ month }}&lt;/h2&gt;
&lt;ul&gt;
    {% for entry in groupedEntries[month] %}
        &lt;li&gt;{{ entry.getLink() }}&lt;/li&gt;
    {% endfor %}
&lt;/ul&gt;


You'll probably want to add error checking and validation in case no entries exist for the month or the month/year is invalid, etc.