Slider button - multi language

Hello,

I have a small issue. I would like to have a button in the slider on the home page linking to the articles page.

I have two languages on my website, and two articles page: polish and english. I would like the button to link to polish articles when the wersite runs polish, and to english articles when the website runs english. How can I do that?

The articles pages are connceted as translations of eachother. Can I somehow link the button to automatically detect what language it is on and to which of the pages it has to link?

-Jacob

Hello Jacob,

Please provide a link to your website and links to both articles pages.

Kind Regards, Roman.

Hello Roman,

Here you go:
Home pages, both languages:


Articles pages, both languages:


Im afraid that it isnt possible without the Polylang Pro tho… Anyway, always worth to ask… right? :slight_smile:

Thanks in advance for the help.

Hello Jacob,

You can try to do this with jQuery.

  1. Please use a link to English version in Dashboard → Appearance → Customize → Header area → Header Slider section.

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

  3. Go to your DashboardSettingsInsert Headers and Footers → add the following code to Scripts in Header section, and click Save button.

<script type='text/javascript'>
    jQuery(document).ready(function(){
        jQuery('html:lang(pl-PL) a.roll-button.button-slider').attr('href', 'http://www.trainslated.com/pl/artykuly/');
    });
</script>

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

Kind Regards, Roman.