WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
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

Your Answer


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.