[resolved] Year is displaying differently on different pages (3 posts)

  1. kalico
    Posted 9 years ago #

    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):

    http://www.timelessword.com/webmaster -- shows 2007
    http://www.timelessword.com -- shows 2006
    http://www.timelessword.com/sermons/gospels/who-is-jesus/who-is-jesus-matthew-1613-16 -- 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 :)

  2. Adam Brown
    Posted 9 years ago #

    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"); ?>

  3. kalico
    Posted 9 years ago #

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


Topic Closed

This topic has been closed to new replies.

About this Topic