My WPML Pro workaround for headers & footers

Hi,

Just wanted to share my workaround for translating content in headers/footers in Pro with WPML.

In my case, I only needed to translate two buttons, but this would also work for other elements. I simply went to “Customize” for the element and entered an ID. I then duplicated the element, translated it, and added a different ID.

I then added the following custom CSS:

#buttonsen:lang(nl){display:none;}
#buttonsnl:lang(en){display:none;}

In this cases, the English buttons are hidden when the language is set to Dutch, and vice versa. This would also work for multiple languages. You could apply it so separate elements like I did, or duplicate an entire bar and do the same thing.

I’ve tested it and it seems to work quite well for me. In some particular cases I could also come up with different workarounds. Let me know in the comments if something’s not working for you.

Hope this helps!

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.