Ready to get started?Download WordPress


A zero displaying in the Archives (23 posts)

  1. tcal
    Posted 9 years ago #


    on my site http://tcal.net/ in the archives down the bottom left - a little 0 is appearing below the various months links that goes to the January 2005 posts. Anyone any suggestions whats causing it? I can't find anything obvious in the index.php or in the archive options.

    Any help really appreciated,


  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    That is very odd indeed ......... is the code that calls the archives just the default code ?

  3. NuclearMoose
    Posted 9 years ago #

    The zero is linked to your Jan 2005 archives. How it got there is a mystery to me. Check your index.php page for anything hand
    coded, but other than that...hmmmm....

  4. tcal
    Posted 9 years ago #

    Thanks for the replies. Here's the code I have in index.php:
    <li id="archives"><?php _e(''); ?>
    <?php wp_get_archives('type=monthly'); ?>



    I don't see anything wrong with that?
    I have phpadmin on hand here, if anyone has _any_ ideas I'd really appreciate it - it's doing my head in.

  5. Kafkaesqui

    Posted 9 years ago #

    My suspicion is that something, somehow, got slipped into the wp_get_archives() function to cause this to appear. So I would check the file wp-includes\template-functions-general.php (around line 190 in 1.2). If you're not comfortable digging around PHP code, try copying the entire function here:


    And link to it in a reply.

  6. tcal
    Posted 9 years ago #


    I had a look myself, but i'm not up to the standard where I'd be confident that there's nothing wrong with it so i've pasted the entire thing like you asked. [expires in 1 week.]

    thanks for the help, anyone else got any suggestions, keep em coming!

  7. NuclearMoose
    Posted 9 years ago #

    Your file is exactly identical to mine.

  8. NuclearMoose
    Posted 9 years ago #

    I'm thinking now you might have to have a peek directly at your database.

  9. chuckblue
    Posted 9 years ago #

    Hmm. Could January, 2005 be named zero in your database to give this ?

    title=" 0"> 0</a></li>

  10. Kafkaesqui

    Posted 9 years ago #

    Yeah, looks fine from here.

    "Could January, 2005 be named zero in your database to give this ?"

    I suspect not, as the current month is already linked (and displayed properly) at the top of the archive list. The 0 link is a dupe of it.


  11. Kafkaesqui

    Posted 9 years ago #

    Ok, 20 Questions time:

    What plugins are you currently running?

  12. NuclearMoose
    Posted 9 years ago #

    What colour is your underwear?
    OH DANG...wrong forum! SORRY! ;)

  13. tcal
    Posted 9 years ago #

    Currently active plugins:

    Brians Latest comments

    Spam Stopgap Extreme


    Just some random thoughts too:
    I sometimes edit timestamp posts - is it possible i entered some bizarre date incorrectly and wordpress let it go into the db.

    I'm quite comfortable using phpmyAdmin to run sql queries, but i just have no idea what i'm looking to find.

  14. Kafkaesqui

    Posted 9 years ago #

    Well if you're up for digging (so few are!), the only place you'd have to check is in the wp_posts table. In phpMyAdmin, select this table in your database, then click the Browse tab to look through the posts. The columns where a timestamp change may have taken effect are:


  15. Kafkaesqui

    Posted 9 years ago #

    Oops, forgot to provide the quick way to look them over:

    SELECT post_date, post_date_gmt, post_modified, post_modified_gmt FROM wp_posts;

    Alter wp_posts if using a different prefix.

  16. Jerry
    Posted 9 years ago #

    Hello. I had the same problem for a few months. I never really tried looking for answers as it didn't bother me too much. However, upon reading this, I looked at the post_date, post_date_gmt, post_modified, post_modified_gmt and fixed some rather odd dates that occurred when I ported over Blogger posts.

    To be honest, I'm not really sure what did the trick but some posts that read 1999 had 1969 instead. When those were fixed, the 0 disappeared.

    Thanks for the lead everyone!

  17. tcal
    Posted 9 years ago #

    I have looked through the dates as above, but i have 1000+ posts in my db so it's pretty hard to spot the problem ones.

    Even just from January (pretty sure thats when the problem appeared, jan 2005) I have about 200 or so posts to look at and just cant find anything obviously wrong like a 1969 date. I also never ported over posts from another cms or anything like that.

    Any chance you can rack your brains Jerry and think about what it might have been that fixed it?

    I know it's a small thing, but I'm on the verge of a relaunch for the site with a brand new layout and all sorts of features etc. and I'd like to get this little niggle out of the way if at all possible.

  18. Jerry
    Posted 9 years ago #

    You know something did come to mind.

    In the wp_posts, along with those 1969 posts, some dates in the "post_date" field that read 0000-00-00 00:00:00. I'm guessing this was what caused the problem. Try sorting "post_date" by ascending order to see if it helps.

    Also, for me, the "0" link didn't just link to January 2005. It always just linked to the current month.

    I'm really sorry I can't be more specific. I never was good with computers.

  19. hisyam
    Posted 9 years ago #

    i had this kind of problem too, i suspect one of your post was not specifically have any dates on it? after i changed my post with a specific date, the zero in the archive is gone. give it a try?

  20. tcal
    Posted 9 years ago #

    Success! I used phpmyadmin to search the entire database for anything with 0000-00-00 00:00:00 in it. And indeed, one item in wp-posts had a date: 0000-00-00 00:00:00 1969-12-31 23:59:59

    Deleted that, and the 0 is gone. Thanks a million to everyone who helped, I know this was a small thing but it was bugging the hell out of me and now it's fixed. :)

  21. NuclearMoose
    Posted 9 years ago #

    Glad to hear it's finally resolved.

  22. gbarber
    Posted 8 years ago #

    Had two posts with this problem and this solution worked for me, so thanks to everyone for the help.

  23. reese
    Posted 8 years ago #

    I thought I'd post my solution to this issue in case it helps anyone.

    I am a phpmyadmin novice...so I was stupid and dropped some stuff and screwed the whole works up. So I deleted WP install and the DB and tried a new install. I noticed the problem was still there.

    The new install, as was the prior one, was from a Fantastico automated install. So I deleted my new install and DB, started over, and this time I did the install myself.

    I don't know why installing from Fantastico caused issues, but when I did a manual install myself, it was completely clean. So, just a caveat for people installing from Fantastico.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.