Flexslider and Right-To-Left language support
Asked Answered
S

5

8

I installed a template on WordPress that contains Flexslider. My language is written Right-To-Left (RTL). When the page is RTL, the Flexslider stops and no images appear. How can I resolve this issue?

Sudden answered 19/9, 2012 at 14:51 Comment(0)
W
11

flex slider doesn't support rtl languages. The only way to fix it is to make the div holding the slider direction: ltr

  1. On your theme, if the slider on the home page find a file called index.php find the div that's holding the slider and all this code style="direction:ltr;" this will display your articles on the slier perfectly

  2. To fix text direction from rtl find a file called flexslider.css on your theme and on the line holding the code .flexslider .slides > li{ (line #25 for me) add this:
    text-align:right;
    direction:rtl;

These tow steps fixed it for me. Good luck

Winou answered 28/9, 2012 at 8:36 Comment(0)
R
8

fatma's answer doesn't work for me. What works is modifying the .flex-viewport by setting direction: ltr:

.flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s  ease; transition: all 1s ease; direction: ltr; }
Radiochemical answered 2/4, 2013 at 2:18 Comment(1)
Voila! fatma's answer didn't work for me either but this one does the trick. Thank you!Reeding
S
2

You need to change both JS and CSS for it to work. Luckily it didn't require much work. I forked the project and added the support at https://github.com/layalk/FlexSlider/tree/rtl. Give it a try.

Simony answered 10/12, 2013 at 14:29 Comment(0)
M
1

To fix directional navigation, these rules in your own stylesheet should override flexslider rules:

/* Flexslider RTL */
.flex-direction-nav .flex-next {background-position: 0 0; left: -36px; right: auto;}
.flex-direction-nav .flex-prev {background-position: 100% 0; right: -36px; left: auto;}
.flexslider:hover .flex-next {left: 5px; right: auto;}
.flexslider:hover .flex-prev {right: 5px; left: auto;}
@media screen and (max-width: 860px) {
  .flex-direction-nav .flex-prev {opacity: 1; right: 0; left: auto;}
  .flex-direction-nav .flex-next {opacity: 1; left: 0; right: auto;}
}
Melton answered 10/4, 2013 at 22:20 Comment(0)
Y
0

I used reverse:true, in flexslider() function and the slider worked in opposite direction than the default.

And

.flexslider .slides li{
    direction: ltr;
}

It worked for me.

Yurev answered 25/5, 2016 at 5:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.