Archived topic
'{{current_year}}' is displayed on WPML translated pages, not the year
4 replies · Started by David on August 13, 2021
Am using GeneratePress Premium, GenerateBlocks & WPML.
In my global footer I display a copyright message within a GP container: © {{current_year}} AME 43.
The year 2021 is correctly displayed on the base English language pages, but on the French pages (created via WPML) the code '{{current_year}}' is displayed instead of the year itself.
What can I do about this? A quick fix is to enter the literal year 2021, but this is obviously not ideal.
Thanks, David
Hi there,
hmmm... not sure on this one, WPML is definitely not my strong suit.
I'll pass this onto Tom to see if he can see what may be the problem.
In the meantime, you could try the method provided here to create a Shortcode for displaying the year:
https://generatepress.com/forums/topic/copyright-icon-custom-footer-with-elements/#post-1847394
Hi David,
Thanks, I created the PHP snippet for shortcode [current_year] as described in the linked thread. Problem now solved.
Glad to hear that - we'll take a look at why the template tag doesn't work.
Thanks for letting us know :)
That's very strange. We simply run the content through the str_replace() PHP function and replace {{current_year}} with the actual year.
I wonder if WPML has any ideas as to why their plugin would prevent this? Have you reported it to them?
Let me know :)