WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] php echo the_time('Y') (3 posts)

  1. Ramzii
    Member
    Posted 1 year ago #

    This php code should generate the current year were living in right?

    <?php echo the_time('Y');?>

    But it still gives 2012?

    I think it has something to do with the hosting server.. any clue? Thanks!

  2. Phil
    Member
    Posted 1 year ago #

    Try this:

    <?php echo date("Y")?>

    the_time references the publish time of the post/page and gives inconsistent values when used outside loops. the_date should be used in templates/footers etc.

  3. Ramzii
    Member
    Posted 1 year ago #

    I love you.

Topic Closed

This topic has been closed to new replies.

About this Topic