Tagged: testimonial
-
AuthorPosts
-
March 24, 2026 at 4:52 am #1496276
Not sure how to describe this, but here goes. :)
I have a testimonial inside a Testimonial Element inside a Color Section. I am using a background image in the Color Section. Some testimonials contain multiple lines of text. This causes the Color Section to expand and contract (height) every time a new testimonial appears.
Is there a way to keep this from moving? I’ve messed around with every combination of settings, but I can’t figure it out.Thanks for any help!
March 24, 2026 at 10:07 am #1496282Hey mjrielly,
Typically the solution is to apply css height so all of the testimony slides will have the same height, and also calculate the needed height for each screen size. The following javascript will do this automatically for you. Add the following code to your child theme functions.php file. If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:

then add the following code and save.function equalise_testimonial_heights() { ?> <script> (function () { function equaliseTestimonialHeights() { const row = document.querySelector('.avia-testimonial-row'); if (!row) return; const slides = row.querySelectorAll('.avia-testimonial'); if (!slides.length) return; slides.forEach(function (slide) { slide.style.height = ''; }); let maxHeight = 0; slides.forEach(function (slide) { const h = slide.offsetHeight; if (h > maxHeight) maxHeight = h; }); slides.forEach(function (slide) { slide.style.height = maxHeight + 'px'; }); } function debounce(fn, delay) { let timer; return function () { clearTimeout(timer); timer = setTimeout(fn, delay); }; } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', equaliseTestimonialHeights); } else { equaliseTestimonialHeights(); } window.addEventListener('resize', debounce(equaliseTestimonialHeights, 150)); })(); </script> <?php } add_action( 'wp_footer', 'equalise_testimonial_heights', 99 );Best regards,
MikeMarch 24, 2026 at 3:30 pm #1496295Perfect! Thank you so much!
March 24, 2026 at 3:35 pm #1496297 -
AuthorPosts
- The topic ‘Testimonial “bouncing”’ is closed to new replies.
