Home › Forums › Support › Make shortcode (year) work in an GP Element This topic has 3 replies, 2 voices, and was last updated 3 years, 1 month ago by Ying. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts March 15, 2023 at 11:37 am #2568971 scometamus Dear GP-team, I used this code in the functions.php to make the “year shortcode” work in an individual html block: /* Add shortcode for year */ function year_shortcode () { $year = date_i18n ('Y'); return $year; } add_shortcode ('year', 'year_shortcode'); This works perfect. But as soon as I add the code [year] to my element hook, it does not get translated to the current year; so doesn’t work. Is there a solution to this? March 15, 2023 at 12:01 pm #2568997 YingStaff Customer Support Hi there, it’s better to use a block element – site footer, you don’t need a custom function for the year, you can use GP’s built-in template tag {{current_year}} in the site footer element. March 15, 2023 at 12:25 pm #2569035 scometamus Fantastic! Best theme/plugins, best support. Thanks! March 15, 2023 at 2:56 pm #2569120 YingStaff Customer Support Glad to hear that 🙂 Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In