Site logo

Archived topic

'{{current_year}}' is displayed on WPML translated pages, not the year

4 replies · Started by David on August 13, 2021

Viewing posts 1–5 of 5

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 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 :)

This archived topic is closed to new replies.