WordPress.org

Ready to get started?Download WordPress

Forums

Change the Year (2 posts)

  1. amnion
    Member
    Posted 1 year ago #

    I run a website for a fictional newspaper based out of the Everwind series of books. I've already changed locale.php to reflect the names of the months and days of the week, but there is a problem. It's still saying 2012 as the year.

    I'd like to transpose the year 2012 with the year 1336 instead. Ideally it would also recognize that it's 1337 after New Year's, etc.

  2. bcworkz
    Member
    Posted 1 year ago #

    It depends on how your theme displays dates. Many themes indirectly use get_the_date(). Meaning this function might called a few levels down from whatever is called from the template. If your theme does this, you can hook the filter 'get_the_date'. Your filter function will be passed the date string. Your function can extract the year, subtract 676 or whatever, then replace the real year in the string with the result, then return this modified string.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags