Slider Language
-
Hello,
thank you for this awesome theme!
I’d like to translate the home page slides.
I’m using poylang, but I can’t find a way to translate them. Is there any way to do it?thank you
-
Hi,
I have checked the theme by using several translation plugins and the slider content are translating properly. Try to use another translation plugin. It might be worth trying to deactivate all other plugins, one at a time, just to make sure the problem is not caused by a conflict between polylang and another plugin. If another translation plugin is working fine and the problem is caused by polylang plugin then you will likely be asked to go find the support forums for that plugin and ask them over there, as it’s not a powen-lite problem, and the translation is not working in the slider content.
Hello Fatima,
Thanks for the reply. Maybe I wasn’t clear. I meant that for any other content the translation is working fine. For the slider I don’t know where I have to put the english content (it is an italian site). In the personalization page of the theme i can put italian content(title,description,image,link) but there is no option for another language.Am i doing something wrong? ??
Hi,
Thank you for clarifying that everything is translating properply and you want to translate the slider content into another language.
It’s not a theme related issue as there is no problem with the translation of the theme. As you are creating a multilingual website and you want to translate a specific content into another language, you can ask the plugin author for help on the support forum.
Thanks
Hello Fatima,
I found a solution, maybe could be useful for someone else.
I have 4 slides in Italian, I want 4 slides in English.So I created 8 slides in the personalization page of the theme, and then in banner.php I have put this code:
<?php /** * Tempate part used in index.php for showing flexslider * @package powen */ $slides = get_theme_mod( 'powen_slides', powen_default_slides() ); $suben = array_slice( $slides, 4, null, true); $subit = array_slice( $slides, 0, 4); ?> <?php if( ! powen_mod( 'hide_slider' , false ) ) : ?> <div id="powen-main-slider" class="clear"> <section id="slider" class="flexslider"> <ul class='slides'> <?php if( is_array( $subit ) && get_locale() == 'it_IT' ) : foreach ( $subit as $slide) : ?> <?php $slide_title = isset( $slide['title'] ) ? $slide['title'] : false; $slide_link = isset( $slide['link'] ) ? $slide['link'] : false; $slide_image = isset( $slide['image'] ) ? $slide['image'] : false; $slide_description = isset( $slide['description'] ) ? $slide['description'] : false; if( ! trim( $slide_image ) ) continue; ?> <li> <a href='<?php echo esc_url( $slide_link ); ?>'> <img src='<?php echo esc_url( $slide_image ); ?>' alt='image'> <?php if( $slide_title || $slide_description ) { ?> <div class='powen-slider-content animated slideInUp'> <h6 class="powen-slider-title"><?php echo esc_attr( $slide_title ); ?></h6> <p class="powen-slider-description"><?php echo esc_attr( $slide_description ); ?></p> </div> <?php } ?> </a> </li> <?php endforeach; endif; ?> <?php if( is_array( $suben ) && get_locale() == 'en_GB' ) : foreach ( $suben as $slide) : ?> <?php $slide_title = isset( $slide['title'] ) ? $slide['title'] : false; $slide_link = isset( $slide['link'] ) ? $slide['link'] : false; $slide_image = isset( $slide['image'] ) ? $slide['image'] : false; $slide_description = isset( $slide['description'] ) ? $slide['description'] : false; if( ! trim( $slide_image ) ) continue; ?> <li> <a href='<?php echo esc_url( $slide_link ); ?>'> <img src='<?php echo esc_url( $slide_image ); ?>' alt='image'> <?php if( $slide_title || $slide_description ) { ?> <div class='powen-slider-content animated slideInUp'> <h6 class="powen-slider-title"><?php echo esc_attr( $slide_title ); ?></h6> <p class="powen-slider-description"><?php echo esc_attr( $slide_description ); ?></p> </div> <?php } ?> </a> </li> <?php endforeach; endif; ?> </ul> </section> </div> <?php endif; ?>
with this I select the 1,2,3,4 slides ( $subit = array_slice( $slides, 0, 4); )
whit this I select the 5,6,7,8 slides ( $suben = array_slice( $slides, 4, null, true); )Then every foreach verifies the current language and returns the right slides.
For sure is not an elegant solution but I think that is a good solution for a so small array.If you have an elegant solution let me know ??
Thank you for the support
- The topic ‘Slider Language’ is closed to new replies.