Topic Development – How do I list articles by year based on URL?

All in all, I try to list posts by year based on the provided URL (for example: wordpressite.com/2004 – this should include all articles created in 2004). Unfortunately, all proposed methods from previous solutions solve the problem when the year is queried.

I've tried to create the year.php file suggested in the wordpress hierarchy as well as in date.php, but the_loop () just prints everything and does not list any articles from that year.


And that is the individual article I would like to have

<a href = "">
<img src = "http://wordpress.stackexchange.com/"class =" archive card image "/>

<? php $ categories = get_the_category (); if (! empty ($ categories)) { Echo & # 39;

I'm still very new to WordPress, I would appreciate any help.

wp_get_archives (& # 39; type = annual & # 39;

The documentation does not specify how I can use my article structure mentioned above.