Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hay, the example on the wp_get_archives documentation page shows how to show a list of all the posts, by months. However if there is no posts for a month, the month doesnt get displayed.

So an example list could look like this

Janauary (5)
March (1)
April (1)
...

Is there a way to force the list to display a month, even if no posts exist?

Thanks

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I've looked over code and it doesn't seem possible with this function.

Months and their post counts are fetched with raw SQL query, for months without posts there are simply no records in database. It doesn't make effort to skip empty month, it simply doesn't get those from database.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.