Single post slider in multilingual

Hi there, I have set a Revolution slider inside single posts using this function:

//Add slider to post

function add_my_slider(){ 
  if(is_singular( array ( 'post', 'momenti') )) {
      echo do_shortcode('[rev_slider alias="t[rev_slider alias="home-hero-slider"]'); 
  }
}
add_action('x_before_view_global__slider-below', 'add_my_slider');

and it works well.

My problem is to load different slider for different languages. So, I have three different slider translated in in three different languages. If the language is the default language, there’s no problem, but if the site is viewed in another language, how can I tell WP to load the slider only for that language?

Thank you very much

Hey Alessandro,

Before I recommend some solutions, please understand that our theme nor our products, in general, do not have multilingual functions. With that said, we are not the right people to be giving you advice.

I’ll try to lead you to the right direction, though. You will need a language conditional inside you if statement. You can try these third-party solutions I found online:

But, if they don’t work, please contact WPML support or consult with a third-party WordPress developer.

Thank you for understanding.

Ok, thank you, I’ve use the pll_current_language and it works like a charme! I should have to think about a polylang function, sorry for bother.

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.