Creating multilingual sliders with Revolution Slider and WPML
Slider Revolution is a WordPress plugin to create responsive sliders with many animation effects, text, image and video layers, and many other features. At least the textual content of the slides’ layers needs to be translated in multilingual sites. In this tutorial we teach you how to do this with WPML.
Revolution Slider can be used to create sliders for a multilingual site in two ways:
- You can create multiple sliders, one for each language, and place the corresponding shortcodes in the appropriate pages. For example, you might have
[revslider slider1]in the English home page, and
[revslider slider1-ES]in the Spanish home page. You can use the ‘duplicate slider’ functionality to streamline the creation of multiple sliders, editing only those parts that need translation in the slides of the duplicated sliders.
- Or you can use Revolution Slider’s (v. 3.1+) direct support for WPML to directly create multilingual sliders. In this case, the same shortcode is used in all languages, but the displayed content is filtered by language. The version in codecanyon.com already supports WPML, so you can just get it from there.
The first method is straightforward, so we describe here only the second one.
Create a slider, with shortcode say
[revslider slider-large]. Set to “on” the option “Use Multi Language (WPML)” under the General Settings box for the slider. Then start adding slides. Clicking on the WPML or flag icon to the left of each slide will bring the following submenu, where you can choose the language of each slide (or let it be multilingual and show in all languages):
You can edit each slide, set its language, and translate the texts, links to landing pages, or other properties –including the images themselves– separately for each language. So you can for example create a slider in your site’s default language, then duplicate all slides (with all their layers, etc.), assign them to different languages, and translate their textual elements. This is what we did in the following image, though we also left one slide untranslated, to be displayed in all languages.
The translated slides are edited with Revolution Slider’s slide editor as usual:
Place the shortcode wherever you want the slider to appear (for example, at the top of your home page post content), or use Revolution Slider custom widget to select it. The slider will show, in each language, only the slides for that language, including those set for ‘all languages’.
And that’s all there is to it.