Query Custom Post Type and sort by year

You don’t need to create a page template to list the project post type, just go to /project/ and you’ll have a full date ordered listing.

The template powering that page will be determined as follows:

  • archive-project.php
  • archive.php
  • index.php

So create an archive-project.php in your theme. Using this you can specify to list only the titles.

Finally, on each post check to see if the year of the data has changed, and if so, echo the year out with whichever markup you please, and continue as usual, making note to echo the year out on the first project post.