• Resolved AngeloLazzari

    (@angelolazzari)


    Hi, i have the home page with a slider (named home-slider) and the italian home page shows correctly the slider with italians text. Now i created (using WPML) the english version of the home page and i uploaded the slider images (different of the italian version), i linked the new EN home page to a new slider home-slider-EN but, when i switch the page… everything is in english but the slider no…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter AngeloLazzari

    (@angelolazzari)

    the site is https://www.mobiix.it

    Hello,
    I’m pretty blind ’cause I don’t have WPML but.. looking at their doc you can try adding the following to your child-theme functions.php:

    add_filter('tc_slider_name_id', 'my_wpml_home_slider');
    function my_wpml_home_slider( $slider_id ){
      if ( tc__f('__is_home') && 'en_EN' == apply_filters( 'wpml_current_language', NULL ) )
        $slider_id = 'home-slider-EN'; /*your english slider name*/
      return $slider_id;
    }

    I’m not sure that wpml filter will return the language code in that form (“en_EN”) but I think is more likely.

    Anyway that’s the Customizr way to change the slider.

    Thread Starter AngeloLazzari

    (@angelolazzari)

    Hi, thank you for the response… i thought it was just a matter of the images linked to the home page, but no, it depends from WPML so?

    Your code it worked but i had to do a little change

    add_filter('tc_slider_name_id', 'my_wpml_home_slider');
    function my_wpml_home_slider( $slider_id ){
      if ( tc__f('__is_home') && 'en' == ICL_LANGUAGE_CODE )
        $slider_id = 'home-slider-eng'; /*your english slider name*/
      return $slider_id;
    }

    Thank you very much!
    Angelo

    Thanks for sharing the solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘slider doesn't change when the home page is managed with WPML’ is closed to new replies.