Home>Support>Multilingual Metaslider on homepage

Multilingual Metaslider on homepage

Hi everyone,

just saw that you moved all your support to here, so I’ll just repost my thread from wordpress.org

I’m atm creating a multilingual website using the vantage theme and polylang plugin. I can translate all needed widgets except the Metaslider on the homepage. I know that there is a way to change sliders in different languages while creating content. An example that works for me there:



But I have problems changing the slider on the homepage. The one that gets shown by the vantage_render_slider function.

Is there a possibility to enter a similar code to the above one for this slider? Currently I’m just creating error after error…

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 2 months ago Philip Spudd

    Somehow the code got lost in my last post, so another try:

  2. 10 years, 2 months ago Philip Spudd
    $currentlang = get_bloginfo('language');
    
        if($currentlang=="en") {
            echo do_shortcode('[metaslider id=8]'); // English
        }
    
        if($currentlang=="de") {
            echo do_shortcode('[metaslider id=30]'); // German
        }
    
        if($currentlang=="es") {
            echo do_shortcode('[metaslider id=32]'); // Spanish
        }
    
        if($currentlang=="ca") {
            echo do_shortcode('[metaslider id=33]'); // Catalan
        }
    
        if($currentlang=="nl") {
            echo do_shortcode('[metaslider id=34]'); // Dutch
        }

    probably this post will turn out to be a black block as well… but another try

  3. 10 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Hi Philip

    Please send through your child theme to [email protected] and I’ll take a look.

  4. 10 years, 2 months ago Philip Spudd

    Hi Andrew,

    Thanks a lot but I figured out a “solution” already. I was all the time trying to change the “function vantage_render_slide” in the function.php, what didn’t work out for me. I still think there is a way, but for my needs it was enough to remove vantage_render_slider() in the header.php and replace it with the following

    $currentlang = get_bloginfo('language');
    
        if( is_front_page()) {
    
             if($currentlang=="en-US") {
                     echo do_shortcode('[metaslider id=8]'); // English
             }
    
             if($currentlang=="de-DE") {
                     echo do_shortcode('[metaslider id=30]'); // German
             }
    
             if($currentlang=="es-ES") {
                     echo do_shortcode('[metaslider id=32]'); // Spanish
             }
    
             if($currentlang=="ca-CA") {
                     echo do_shortcode('[metaslider id=33]'); // Catalan
             }
    
             if($currentlang=="nl-NL") {
                     echo do_shortcode('[metaslider id=34]'); // Dutch
             }
        }

    I can’t change the slider through Vantage Customize anymore, but that’s not a big deal, as this can be achieved by editing each slider directly in the Metaslider plugin. I use the responsive layout option and when the sliders are well configurated in Metaslider this works fine. Just in case this might help someone else.

  5. 10 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for sharing – glad you got this sorted.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More