Tagged: bilingual site, header extra elements, theme-options, wpml
Dear Kriesis,
I’m running a website in german an english and want to add different shortcodes (for different advertisements) in the headers extra Elements > Header Phone Number/Extra Info:
German version : Sponsored by [adrotate group=”1″]
English Version: Sponsored by [adrotate group=”5″]
Unfortunately it doesn’t work like this and I can choose only one info text for both versions. If I try to add the other shortcode or info text, this aplies to the other language version too, what is not wanted. What to do?
Best Regards Anne
Hey annevoelkel,
Thank you for the inquiry.
Are you currently utilizing the Polylang plugin? If so, please refer to the following threads for assistance.
// https://kriesi.at/support/topic/cookie-hinweis-mehrsprachige-website/#post-1323341
// https://kriesi.at/support/topic/copyright-mit-datenschutz-jeweils-extra-fur-deutsche-und-englische-website/#post-1318612
// https://kriesi.at/support/topic/privacy-policy-multilingual/#post-1334929
The idea is to create another custom shortcode that displays different contents based on the current language.
Best regards,
Ismael
Hello Ismael,
thank you for your quick reply. I’m using the WPML plugin.
Best Regards
Anne
Hi,
Thank you for the info.
For the WPML plugin, you can replace the adrotate shortcodes with the following html elements.
<div class="adrotate_container de">[adrotate group="1"]</div>
<div class="adrotate_container en">[adrotate group="5"]</div>
Then use this css code to toggle the visibility of the containers based on the active language.
.adrotate_container {
display: none;
}
html[lang=en-US] .adrotate_container.en {
display: inline-block;
}
html[lang=de-DE] .adrotate_container.de {
display: inline-block;
}
Best regards,
Ismael
Hi Ismael,
thanks a lot for the code – it works! You can close the topic.
Best regards
Anne