Archived topic
Translating hook element changes it into a block hook - WPML
3 replies · Started by Kevin on April 4, 2022
I'm adding Facebook pixel tracking to a multilingual website (using WPML). Adding a hook to wp_head works fine on the English side.
When I duplicate this to create the French translation and add the French pixel, it turns the hook into a block hook, and the only way I can add the code is to treat it as a custom HTML block.
How can I change a (French language) block hook into a regular hook, like the original?
Thanks!
Hi Kevin,
It doesn't sound right, neither hook element or block element can not be converted to another.
Can you provide admin access and let us know which hook we should be looking at?
You can use the private info field for this kind info, it will only be seen by GP support team.
Please keep all plugins deactivated except GP premium and WPML.
Let me know :)
Hi,
I figured out what was going wrong. When WPML tries to create a translation of a hook element, it turns it into a block hook.
In order to get the translated element back to the proper type, I had to click the "Overwrite with English Content" when editing the French translation, then translate the item individually rather than through WPML. This forced the element to be the same type as the original.
Hope this helps someone else who gets stuck on this.
Thanks for sharing this with us :)
I'm sure it will be useful for other WPML users!