Different links under button in header

Hi there,

My website is available in 3 different languages and I would like the button in the header (the one that says “Find out more” on the landing page) to link to the page that’s in the same language.

At the moment, on the 3 versions of the website (Russian, Danish and English) the button only links to the English page.

Any idea how to solve this problem?

Thx a lot in advance!

Hi there,

Please try these steps below:

  1. Install javascript plugin https://wordpress.org/plugins/tc-custom-javascript/
  2. Go to Appearance > Custom Javascript > then add the snippet code below:
jQuery(function($){
	var lang = $('html').attr('lang');
	var btn = $('.header-button a.button');

	if(lang == 'en-GB'){
		btn.attr('href', location.protocol+'//'+ location.host +'/en/arctic-commitment');

	}else if(lang == 'da-DK'){
		btn.attr('href', location.protocol+'//'+ location.host +'/da/den-arktiske-forpligtelse');

	}else if(lang == 'ru-RU'){
		btn.attr('href', location.protocol+'//'+ location.host +'/ru/арктическое-обязательство');
	}
});

Regards,
Awan

Amazing! Thank you so much Awan!