Different link on the button page with different language

Hello

Thank you first to put at your disposal your free template! (For people who start in this branch it’s great!

I can write to you because I have a small technical problem with the button that is on the HP [header area -> leader text -> Button Url in the customization part]

Let me explain: I made a site in 3 languages following the recommendations of the forum authors with the Polylang plugin that works wonderfully with your theme, everything is translated,

But I have no solutions for that: 3 HP with each buttons,

  • the first one is ok because it’s the first language and the link url are on good page,

  • for the other i can’t put the another link in the second HP with a button to link in the right page and it’s the same the the third.

That’s why I ask you for help!

( i’m sorry for my bad english too )
Thank you in advance for your answers .
Best regards

Hello,

Please provide a link to your home page and to those two pages that should be linked from button in additional languages.

Kind Regards, Roman.

Hello Roman, thx for your answer!

here the link to a explication picture ( boro.lu/demo/axiome/_HP_3lang.jpg ) and the link to my demo ( boro.lu/demo/axiome) , thank you again for the question : how to change the link button in HP to go to the right language for the blog ? (every language are create with polylang)

Best regards

S.

Hello,

That button link might be available for translation from Polylang plugin in future Astrid version, I have just added it to our list.

As a temporary workaround, you can try to do this with jQuery.

  1. Please install and activate Insert Headers and Footers plugin that will allow you to insert JavaScript (jQuery) code.

  2. Go to your Dashboard → Settings → Insert Headers and Footers → add the following code to Scripts in Header section, and click Save button.

<script>
    jQuery(document).ready(function(){
        jQuery('html[lang=|en] a.button.header-button').attr('href', 'http://www.boro.lu/demo/axiome/en/we-are-looking-for/');

        jQuery('html[lang=|ru] a.button.header-button').attr('href', 'http://www.boro.lu/demo/axiome/ru/%d0%bc%d1%8b-%d0%b8%d1%89%d0%b5%d0%bc/');
    });
</script>

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

P. S.
Your Russian translation doesn’t seem to be good at all, you might want it to be checked by native Russian speaker.

Hello Roman

Thank you for the quick reply again once unfortunately once the code copied in the plugin the site no longer wants to load (boro.lu/demo/axiome/Print_screen.jpg and boro.lu/demo/axiome/Print_screen_ 2.jpg ) I tried removing the Russian language because I saw that there were percentages but that did not Not worked even.
If you still have another idea to help me i will be delighted !

thank you very much
Best regard
S.

PS: Thank you for this remark, the translation of the Russian language actually come from Google and it does not have to be the best happily it’s just the waiting text of the person who has to do the translation :slight_smile: !

Hello Roman

I found another code that you wrote on the forum ( https://athemes.com/forums/topic/index-button-language-need-different-links/ ) it is slightly different and I tested it and it works!
What do you think ?
Thanks to you very much again, if you have another suggestion for me i will be happy to read you.

Best regard
S.

Hello,

Please try this code instead of previous:

<script>
    jQuery(document).ready(function(){
        jQuery('html[lang=|en] a.button.header-button').attr('href', 'http://www.boro.lu/demo/axiome/en/we-are-looking-for/');

        jQuery('html[lang=|ru] a.button.header-button').attr('href', 'http://www.boro.lu/demo/axiome/ru/желанный/');
    });
</script>

Kind Regards, Roman.

Hello Roman,

Thank you for this other code it works very well, just a small question : if I have to change the address of the page I must obviously change the link in the code so that it can still work isn’t it?
Thank you for your support and again thank you for your free themes i find very great !

Best regard
S.

Hello, yes, you’ll have to change the link in code.

By the way, it would be nice if you leave your feedback for Astrid theme on WordPress.org, here is a quick link :slight_smile:

Kind Regards, Roman.

Hello Roman

Done ! With pleasure .
Best regard
S.

Thank you very much! :slight_smile:

Kind Regards, Roman.

Hello!
I have the same problem on this site: https://www.canovi.wine

I tried to follow these steps but doesn’t work for me!

Can you help me?

Thank you very much!

Hello,

Please create a new topic for your issue to keep forum in good order and make it easier to help you.

Kind Regards, Roman.