Tagged: slider, testimonials
-
AuthorPosts
-
August 21, 2018 at 5:10 pm #999900
Hi I’m looking to randomise testimonials. I looked at this topic (https://kriesi.at/support/topic/randomize-testimonials-slider/) but it seems to be outdated. Thank you for your assistance.
August 22, 2018 at 12:49 pm #1000279Hey sparkzilla,
The code is fine, except it has moved to this file
/enfold/config-templatebuilder/avia-shortcodes/testimonials/testimonials.jsIf you need further assistance please let us know.
Best regards,
VictoriaAugust 22, 2018 at 1:48 pm #1000318Hi, I have tried both the code combinations on the original page and neither work. I have placed the file in a child theme, using the same directory structure. Her’s the entire code of the testimonials.js page. You can see the output at: https://newsblocks.io/news-is-data/
(function($) { "use strict"; // ------------------------------------------------------------------------------------------- // testimonial shortcode javascript // ------------------------------------------------------------------------------------------- $.fn.randomize = function(childElem) { return this.each(function() { var $this = $(this); var elems = $this.children(childElem); elems.sort(function() { return (Math.round(Math.random())-0.5); }); $this.remove(childElem); for(var i=0; i < elems.length; i++) $this.append(elems[i]); }); } (jQuery); $.fn.avia_sc_testimonial = function(options) { return this.each(function() { jQuery(".avia-testimonial-row").randomize(".avia-testimonial"); var container = $(this), elements = container.find('.avia-testimonial'); //trigger displaying of thumbnails container.on('avia_start_animation', function() { elements.each(function(i) { var element = $(this); setTimeout(function(){ element.addClass('avia_start_animation') }, (i * 150)); }); }); }); } }(jQuery));
August 22, 2018 at 6:10 pm #1000454Hi,
I see the testimonials appear in the sidebar but I could not make out if it was random or not? Please let us know if the above code worked for you or you need any further assistance.
Best regards,
VinayAugust 22, 2018 at 8:49 pm #1000515The above code does not work.
August 24, 2018 at 12:05 pm #1001160Hi,
It would be much easier to just use a plugin like https://wordpress.org/plugins/testimonials-widget/ and display the widget in the sidebar.
Best regards,
Vinay -
AuthorPosts
- You must be logged in to reply to this topic.