Support » Fixing WordPress » Year is displaying differently on different pages

  • Resolved kalico


    I have tried searching, but it’s not turning up anything. Maybe I don’t know what to search for.

    I am getting a different year displaying in my sidebar, depending on which page is calling it!! The sidebar code remains the same…but on my Pages and posts, the year is 2006, and on a category page, the year is 2007.

    Here are two examples (see the copyright info on the right, bottom of sidebar): — shows 2007 — shows 2006 — shows 2006

    The code for all of these is the same:

    2000-<?php the_time('Y', '', ''); ?>

    I have tried the_date and it’s the same result.

    Any thoughts? I am not even sure where to begin. Oh, I am using WP 2.1.3, just upgraded but the problem has been there since 2.0.5. I am using a completely custom theme I built from the ground up. If there is any other info I can supply, I would be glad to.

    TIA 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • replace the_time with date. the_time is a WP function that uses the year provided by the loop. But what you want is the current year, regardless of what displays in the loop. So use date, a PHP (not WP) function. Should look like this:

    `2000-<?php echo date(“Y”); ?>

    HOORAY! Bless you sir, you solved my problem! Thank you so much…my pages are no longer in the twilight zone.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Year is displaying differently on different pages’ is closed to new replies.