# Theme with archive of posts organized chronologically

**URL:** <https://forum.ghost.org/t/theme-with-archive-of-posts-organized-chronologically/20576>\
**Category:** Developer help\
**Created:** [March 5, 2021, 7:33pm UTC](https://forum.ghost.org/t/theme-with-archive-of-posts-organized-chronologically/20576 "2021-03-05T19:33:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [June 30, 2022, 5:26pm UTC](https://forum.ghost.org/t/theme-with-archive-of-posts-organized-chronologically/20576/4 "2022-06-30T17:26:31Z")

</div>

I don’t think there’s an easy way to do this with Ghost. There’s some newer discussion with some example SQL to get a list of months or years that contain posts and the count for each month. What’s missing is connecting the result that query with the frontend templates:

> [@Filter Posts by Date Block](https://forum.ghost.org/t/filter-posts-by-date-block/31067/8):
>
> The solution by @denvergeeks would work, but involves selecting the details of every post from the database, sending a lot of data to the frontend that will be discarded, and then having the browser process every post to come up with the result. Here’s example of what it looks like to query this data directly using SQL. I’ve provided an example of querying the by-month counts and also by-year counts. You can see the report that both queries take “0.00” seconds for a small dataset, and this woul…

---

_[View the full topic](https://forum.ghost.org/t/theme-with-archive-of-posts-organized-chronologically/20576)._
