Answers.Body: <p>Try this:</p>
  
  <pre><code>{% set year = craft.request.segment(4) %}
  {% set month = craft.request.segment(5) %}
  
  {% set entriesInYear = craft.entries.section('bulletinOnline').limit(null).after(year).before(year+1) %}
  {% set groupedEntries =  entriesInYear | group("postDate|date('m')") %}
  
  {% for year, entriesInYear in allEntries | group("postDate.year") %}
      {% for month, entries in entriesInYear | group("postDate|date('m')") %}
  
          &lt;a href="{{ url('/archive/')}}/{{ year }}/{{ month }}"&gt;
          {{ month |date((year + 1) ~ '-' ~ month ~ '-01')|date('M') }}&amp;nbsp;({{ entries|length }})&lt;/a&gt;
      {% endfor %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-03T00:42:28.497Z
Answers.LastActivityDate: 2019-05-03T00:42:28.497Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm trying to figure out how I can print the month name i.e April in the below. Currently, it's printing the last three months that contain entries.</p>
  
  <pre><code>{% set year = craft.request.segment(4) %}
  {% set month = craft.request.segment(5) %}
  
  {% set entriesInYear = craft.entries.section('bulletinOnline').limit(null).after(year).before(year+1) %}
  {% set groupedEntries =  entriesInYear | group("postDate|date('m')") %}
  
  {% for year, entriesInYear in allEntries | group("postDate.year") %}
      {% set counter = ( counter | default(0) ) + 1 %}
  
      {% for month, entries in entriesInYear | group("postDate|date('m')") %}
  
          &lt;a href="{{ url('/archive/')}}/{{ year }}/{{ month }}"&gt;
              {% for monthWord, entries in entriesInYear|group("postDate|date('F')") %}
                  {{ monthWord }}
              {% endfor %}
              &amp;nbsp;({{ entries|length }})
          &lt;/a&gt;
      {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>Example output:</p>
  
  <pre><code>&lt;a href="'/archive/2019/04/"&gt;MarchAprilMay(2)&lt;/a&gt;
  </code></pre>
  
Tags: <datetime><postdate><archives>
Title: Displaying a month name in an archive
ThreadText: # Displaying a month name in an archive
  
  (Asked by: username_0 on 2019-05-02)
  
  I'm trying to figure out how I can print the month name i.e April in the below. Currently, it's printing the last three months that contain entries.
  
  ```
  {% set year = craft.request.segment(4) %}
  {% set month = craft.request.segment(5) %}
  
  {% set entriesInYear = craft.entries.section('bulletinOnline').limit(null).after(year).before(year+1) %}
  {% set groupedEntries =  entriesInYear | group("postDate|date('m')") %}
  
  {% for year, entriesInYear in allEntries | group("postDate.year") %}
      {% set counter = ( counter | default(0) ) + 1 %}
  
      {% for month, entries in entriesInYear | group("postDate|date('m')") %}
  
          <a href="{{ url('/archive/')}}/{{ year }}/{{ month }}">
              {% for monthWord, entries in entriesInYear|group("postDate|date('F')") %}
                  {{ monthWord }}
              {% endfor %}
              &nbsp;({{ entries|length }})
          </a>
      {% endfor %}
  {% endfor %}
  
  ```
  
  Example output:
  
  ```
  <a href="'/archive/2019/04/">MarchAprilMay(2)</a>
  
  ```
  
  **Tags:** datetime, postdate, archives
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-03. Score: 1 | Accepted answer
  
  Try this:
  
  ```
  {% set year = craft.request.segment(4) %}
  {% set month = craft.request.segment(5) %}
  
  {% set entriesInYear = craft.entries.section('bulletinOnline').limit(null).after(year).before(year+1) %}
  {% set groupedEntries =  entriesInYear | group("postDate|date('m')") %}
  
  {% for year, entriesInYear in allEntries | group("postDate.year") %}
      {% for month, entries in entriesInYear | group("postDate|date('m')") %}
  
          <a href="{{ url('/archive/')}}/{{ year }}/{{ month }}">
          {{ month |date((year + 1) ~ '-' ~ month ~ '-01')|date('M') }}&nbsp;({{ entries|length }})</a>
      {% endfor %}
  {% endfor %}
  
  ```
  
  
  ---
  
  