• I wrote the following article showing how to add localized sliders to any WordPress Home Page: localization plugin ain’t required since the method will use WP built-in functions and act accordingly. I thought this is the right place to share the knowledge in case someone needs to do the same.

    I’m also dropping the relevant code here in case someone needs it:

    <?php if (is_front_page() || is_home()) {
        $curLang = substr(get_bloginfo( 'language' ), 0, 2);
        switch ($curLang) {
            case "it":
                // italian slideshow for italian users
                echo do_shortcode("[metaslider id=896]");
                break;
            case "de":
                // german slideshow for german users
                echo do_shortcode("[metaslider id=897]");
                break;
            case "fr":
                // french slideshow for french users
                echo do_shortcode("[metaslider id=898]");
                break;
            case "en":
            default:
                // fallback to english slideshow for any other language
                echo do_shortcode("[metaslider id=894]");
                break;
        }
    }
    ?>

    Thanks again for the great plugin.

  • The topic ‘Multi-language slideshow in Home Page (without WPML)’ is closed to new replies.