WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Unexpected "0" month in wp_get_archives() output (4 posts)

  1. Raam Dev
    Member
    Posted 3 years ago #

    My archives page uses the wp_get_archives() function to create a drop-down box that lists each of the months for my archives.

    <?php wp_get_archives('type=monthly&format=option&show_post_count=0'); ?>

    It works fine, except for the fact that the very last entry is a "0" (that's a zero):

    April 2010
    March 2010
    February 2010
    January 2010
    December 2010
    0

    Selecting the zero always links to the current month's archive. Any idea what's causing this?

  2. Jonas Grumby
    Member
    Posted 3 years ago #

    Try taking out &show_post_count=0. Since false is the default you should not need that argument to be there at all.

  3. MichaelH
    Member
    Posted 3 years ago #

    Use phpMyAdmin and look at your posts table, then sort your posts by clicking on the post_date column--going to guess there's a post in there with a bad or blank date.

  4. Raam Dev
    Member
    Posted 3 years ago #

    Thanks MichaelH! That was the problem. One of the posts had a date of 0000-00-00 00:00:00.

Topic Closed

This topic has been closed to new replies.

About this Topic