How to create custom function to get WordPress Archives by year?

Hi people I know WP has its method to get archives year by calling wp_get_archives()

But this method will get a list of archive years which on click it will redirect to all post of the year itself.

I want to customize the same function just to get a list of years which I have a second use for the years selections.

example. after I click on the year I can get all available post by months of the year and its post count in each month.

anyone please help with the code to get to this. Thanks

Read more here: How to create custom function to get WordPress Archives by year?

Leave a Reply

Your email address will not be published. Required fields are marked *