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

    Gday Enfold users

    Does anyone know a way to add a dynamic current year to the socket using a function in my child theme?

    I’d prefer not to edit the footer.php file directly, nor a copy of it in the child theme (as these files at times need replacing when the parent socket files change).

    A shortcode in the theme options text field would be even better, if at all possible?

    cheers

    Darryl

    #502644

    Hey Darryl!

    Please add following code to Functions.php file of your child theme in Appearance > Editor

    function avia_year_func( $atts ){
    	return date("Y");
    }
    add_shortcode( 'cur_year', 'avia_year_func' );

    and then go to Enfold theme options > Footer and insert following shortcode into copyright field

    [cur_year]

    to echo current year – http://kriesi.at/documentation/enfold/change-the-footer-text-and-link/

    Best regards,
    Yigit

    #502652

    Yigit! Thanks so much, this is perfect…thanks for your prompt reply.
    cheers
    Darryl

    #502665

    Hey!

    You are welcome Darryl, we are always happy to help :)
    Let us know if you have any other questions or issues!

    Cheers!
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How do I add a dynamic current year to socket?’ is closed to new replies.