Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11654

    Hi there!

    I’m always working in small steps on my website. :-)

    So I tried to get a function to update my copyright-notice every year.

    This is a part of my sidebar.php

    echo "Copyright &copy; 2009 - 2012 <br> my name <br>Alll rights reserved.<br>";
    echo "<a href="/impressum"><b>Impressum</b></a>";

    Than I asked Google for a solution and got this:

    <?php echo date(Y); ?>

    But everything I tried was wrong. :-(

    Any hints to solve this small problem?

    Thank you in advance!

    Dennis

    #72519

    Look at this solution: http://gostomski.co.uk/2012/01/better-auto-updating-copyright-date/

    You just need to call the function. You might need to jump through a few hoops to get it in a sidebar directly, unless you make your own widget for the function itself.

    EDIT: add it to the end of functions.php. then use this – http://wordpress.org/extend/plugins/php-code-widget/

    #72520

    Hi!

    Instead of:

    echo "Copyright &copy; 2009 - 2012 <br> my name <br>Alll rights reserved.<br>";

    use:

    echo "Copyright &copy; 2009 - ".date('Y')." <br> my name <br>All rights reserved.<br>";

    Regards,

    Peter

    #72521

    @ Peter: Thank you! That’s perfect and now I know my mistake! ;-)

    #72522

    Hi!

    Great :)

    Best regards,

    Peter

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Autoupdating year for copyright?’ is closed to new replies.