Multilanguage website: How to create different headers for different languages?

Posted in: Newspaper
Post count: 33

I use Romania News template. I use polylang for multi language of my website.
I have 2 different home page for 2 different languages. (you can see the multi-lang function – https://imgur.com/WYLDWub)

But when I try to change the element in the header of the page of one language, the element in the header of the other page is also changed as the same (The element is in the blue circle: https://imgur.com/eaHMuLZ). Can I separate them? I want 2 different headers.

Post count: 35449

Hi,

Unfortunately we do not tested the polylang plugin with our website, you have tested only the wpml plugin and for this you can make a new page per langues, here is an example -> https://wpml.org/documentation/theme-compatibility/create-multilingual-wordpress-websites-using-the-newspaper-theme-and-wpml/

Thank you for your understanding!

Post count: 33

Can I add custom Javscript code in themepanel to solve it?
In my previous website I could add these code to solve it. (chinaworker.info)

Maybe something I need to make some small chagnes? like div#logo img

These are the code I used in the previous site.

jQuery(function($){
var lang = $(“html”).attr(“lang”);
var imgPath = “”;
if (lang ==”en-US”){
imgPath = “https://chinaworker.info/wp-content/uploads/2013/05/header1-1.png”;
} else if(lang ==”zh-CN”){
imgPath = “https://chinaworker.info/wp-content/uploads/2013/05/header1-1.png”;
} else if(lang ==”zh-HK”){
imgPath = “https://chinaworker.info/wp-content/uploads/2020/02/headerhk1-HK.png”;
}
$(“div#logo img”).attr(“src”,imgPath);
});

Post count: 35449

Hi,

The code can be set in theme panel, in this section -> https://i.imgur.com/MlzY0rz.png also if the code need to be set in the head or end body, you can set it here -> https://i.imgur.com/jVvkosO.png also in this section, you’ll need to add the <script> </script> tags to your code.

Hope this will help you!
Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.