Forums

[resolved] Display year question (4 posts)

  1. thewebscaper
    Member
    Posted 3 years ago #

    I can't be the first person to ask this question, but I tried searching Codex and these forums, but did not find an answer...

    In my footer I want to put my copyright statement but instead of typing the year "2009" I want to have it dynamically pull in the current year and display it. I do this all the time on my non-WP sites (Windows/ASP code) and I am sure there's an equivalent, I just can't seem to find it.

    Any help would be much appreciated.

  2. thewebscaper
    Member
    Posted 3 years ago #

    My apologies, a Google search turned up my answer, and yes it's me being rookie to PHP. Should anyone else ever need the answer, you simply add '<?php echo date("Y") ?>' to the html in place of your year.

  3. MichaelH
    Volunteer
    Posted 3 years ago #

    In your theme's footer.php

    <?php
    echo 'the current year is '. date('Y');
    ?>
  4. MichaelH
    Volunteer
    Posted 3 years ago #

    Oops, see you got caught by Akismet for some reason. Thanks for the feedback.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.