Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #943043

    Hi

    I would like to automatically add the current year to the copyright line in the socket so that it appears as.

    © 2012 – 2018 Company name
    I have tried the following:

    © 2012 - <?php echo date("Y"); ?> Company name [nolink]

    but the current year does not appear.

    Is there a way to do this?

    Many Thanks
    Regards
    Colin

    #943093

    do this to functions.php of your child-theme:

    function year_shortcode() {
      $year = date('Y');
      return $year;
    }
    add_shortcode('year', 'year_shortcode');

    after that you can input in the footer copyright field:

    © Copyright - [year] - Company Name  [nolink]
    
    #943106

    Hi

    That is perfect. Thank you for the solution Guenni007.

    Regards
    Colin

    #943407

    Hi,

    Thanks for sharing @guenni007 :-)

    Please let us know if you should need any further help on the topic or if we can close it @waveseven.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.