Antimatter theme date


The date within the Antimatter theme only shows day and month, I’d love to add the year as well, is there an easy way to do that?


Hi @techielass, I think you would need to modify the Twig code to do this… here is an example:

  1. Open the file /user/themes/antimatter/templates/partials/blog_item.html.twig

  2. Change this bit of code:

         <time class="dt-published" datetime="{{|date("c") }}">
             <span>{{|date("d") }}</span>
             <em>{{|date("M") }}</em>

    to this:

         <time class="dt-published" datetime="{{|date("c") }}">
             <span>{{|date("M") }} {{|date("d") }}</span>
             <em>{{|date("Y") }}</em>
  3. Save this file and reload Blog page to see changes (clear cache as well).

Just as a heads up, if you want to make any template changes like this it is best to do so by first setting up an inherited theme, but since Quark is now the base theme of Grav there has not been an update to Antimatter in quite a while (which could over-write any file changes you make).

Please let me know if the above helps.

1 Like

That’s awesome, thank you!

I’d been staring at it for ages and couldn’t figure it out. :slight_smile:

1 Like