Tagged: enfold, slider, support, testimonial
-
AuthorPosts
-
May 16, 2020 at 11:32 am #1213540
I have the same issue with the testimonial slider height changing with the varying testimonial lengths.
I have tried a few custom CSS mentioned in other threads here but none of them worked.
I have attached the link where the slider is for you to assist me.May 16, 2020 at 1:22 pm #1213549Hi,
Thanks for the link, the following script looks for each testimonial slider and finds the tallest inner content and then sets all of the sliders to the same height. Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_testimonial_height_script(){ ?> <script> (function($){ $(window).load(function(){ $('.avia-testimonial-row').each(function(){ var $columns = $('.avia-testimonial_inner',this); var maxHeight = Math.max.apply(Math, $columns.map(function(){ return $(this).height(); }).get()); $columns.height(maxHeight); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_testimonial_height_script');
This code sets the height of
.avia-testimonial_inner
which keeps the testimonial author title close to the content, this screenshot highlights the area.
If you replace.avia-testimonial_inner
with.avia-testimonial-content
in the code then the testimonial author title will stay in the same place for each slider, this screenshot highlights the area.
This script will work across your whole site, you can always restrict this to the one page by adding the page ID#top.page-id-5666
to the beginning of.avia-testimonial-row
with a space like this:
#top.page-id-5666 .avia-testimonial-row
Please clear your browser cache and check after adding this code.Best regards,
MikeMay 17, 2020 at 12:10 pm #1213786Thank you very much Mike.
It worked just fine. The height variations have stopped and I have a fixed height testimonial slider.Furthermore, the text size of the testimonials are varying.
Could we please ensure that the text size is standard for all testimonial entries?Thank you!
May 17, 2020 at 12:53 pm #1213795Hi,
Glad to hear, the one testimonial entry that has a different font size is in some extra div’s, please check this one and adjust to how the others are.Best regards,
MikeMay 17, 2020 at 1:32 pm #1213803Alright Mike.
Further to the testimonial slider –
1) How can I fix the height for mobile screens too?
2) how can i adjust the font size of the testimonials in the testimonial slider only for mobile screens? Because currently the testimonials look gigantic on phone.Thanks!
May 17, 2020 at 7:47 pm #1213854Hi,
What do you mean by “fix the height for mobile screens too” for mobile the script works correctly, it finds the tallest inner content and then sets all of the sliders to the same height. The problem I see is that one of your testimonials is very long so all of them will be. I recommend making the testimonials shorter or having a second testimonial for mobile only with all short comments.
You can also try this css that removes the padding for mobile and reduces the font size.@media only screen and (max-width: 767px) { .avia-testimonial { padding: 0px !important; } #top .av-large-testimonial-slider .avia-testimonial-content { font-size: 1em !important; } #top .av-large-testimonial-slider .avia-testimonial-meta .avia-testimonial-image { margin: auto !important; } }
Best regards,
MikeMay 18, 2020 at 8:35 am #1213938Hi Mike, the slider section is working fine now. Perhaps I hadn’t refreshed the webpage on my phone and hence the misinformation.
I will try the above CSS to reduce font size on the mobile.Plus, how do you create a ‘second testimonial slider’ with only shorter testimonials for mobile screens?
Thank you.
May 18, 2020 at 10:56 am #1213976December 19, 2020 at 11:29 am #1268607Hi
I use the code from Mike shown in #1213549
Now I recognise a strange behaviour: If the selected language is English, then it works fine. When the default language German is selected, then the testimonial jumps around like I did not use the code. I use the latest WPML plugin for language selections. Disabling all plugins does not change behaviour.
Any hint and support would be much appreciated.
Thanks
AndreasDecember 20, 2020 at 2:52 am #1268701Hi,
@Andreas thank you for the links and login, I found that on your [DE] stagging site the jQuery Migrate theme setting was off, while on the [EN] site it was on.
This was giving the error:Uncaught TypeError: e.indexOf is not a function
it seems that jQuery Migrate is needed.
I corrected this and it seems to work now, please clear your browser cache and check.Best regards,
MikeDecember 20, 2020 at 10:51 am #1268743Hi Mike
You are a hero. It works now.
If any problem could be fixed with turning a switch on or off live could be much easier 😉
Many thanks,
AndreasDecember 20, 2020 at 11:49 am #1268749Hi,
Glad we could help, and thank you for using Enfold and for your patience.
As this thread was started in 2016, I will be closing this thread now.
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Stop testimonials slider from jumping around’ is closed to new replies.