WordPress.org

Ready to get started?Download WordPress

Forums

Testimonials by Aihrus
[resolved] [Plugin: Testimonials Widget] Next Testimonial (not pagination) (17 posts)

  1. brian7997
    Member
    Posted 1 year ago #

    For those who want a "next testimonial" link, to skip to the next testimonial in the rotation, this is what I did.

    Add this to your header or footer:

    <script type="text/javascript">
    
    	jQuery(document).ready(function(){
    			jQuery('.next-testimonial').click( function() {
    				nextTestimonial100000();
    			})
    	});
    </script>

    The function name "nextTestimonial100000()" will change based on the instance of the widget you want to target.

    Now where ever you want the next button be (for me, below the testimonials) you will need to add an HTML element with the class "next-testimonial"

    e.g.
    <span class="next-testimonial">next</span>

    Also this doesn't turn off the rotation only initiates it early, so if you want to disable the auto-rotate, I suggest setting the interval to a high number (e.g. refresh_interval=99999999)

    I added a next link because by testimonials are longer and various lengths, so the timing is tricky. Also I wanted an indicator that there are more testimonials.

    http://wordpress.org/extend/plugins/testimonials-widget/

  2. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    brian7997, that's cool. I hadn't thought of that. I'll see about making this a feature.

  3. delatdecatsini
    Member
    Posted 1 year ago #

    The function name "nextTestimonial100000()" will change based on the instance of the widget you want to target.

    How to check id of instance of the targeted widget? I've try your code but not success

  4. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Look in the source code of your page for the testimonials widget and then you'll see the code like nextTestimonial100000.

  5. delatdecatsini
    Member
    Posted 1 year ago #

    Look in the source code of your page for the testimonials widget and then you'll see the code like nextTestimonial100000.

    I look in the source code of testimonials widget and see:

    static $widget_number = 100000;

    and:

    <script type="text/javascript">
    
    	function nextTestimonial$widget_number() {
    		if (!jQuery('.$id_base').first().hasClass('hovered')) {
    			var active = jQuery('.$id_base .testimonialswidget_active');
    			var next = (jQuery('.$id_base .testimonialswidget_active').next().length > 0) ? jQuery('.$id_base .testimonialswidget_active').next() : jQuery('.$id_base .testimonialswidget_testimonial:first');
    			active.fadeOut(1250, function(){
    				active.removeClass('testimonialswidget_active');
    				next.fadeIn(500);
    				next.addClass('testimonialswidget_active');
    			});
    		}
    	}
    
    	jQuery(document).ready(function(){
    		jQuery('.$id_base').hover(function() { jQuery(this).addClass('hovered') }, function() { jQuery(this).removeClass('hovered') });
    		setInterval('nextTestimonial$widget_number()', $refresh_interval * 1000);
    	});
    </script>

    but script of brian7997 to added to header(or footer) it don't work, click "next" don't change anything. Sound like the problem is nextTestimonial100000 function but i don't know how to fix. So i'll wait your next release version with this usefull feature

  6. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Look in the source code of your web page, not the PHP source code.

  7. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Any suggestions on styling the "Next testimonial" link?

    I'm close to coding this, but want the user experience sorted out beforehand.

  8. delatdecatsini
    Member
    Posted 1 year ago #

    My "Next testimonial" link still can't click, glad to see you code this function, that easy for newbies. My styling: http://ns8.upanh.com/b3.s33.d3/9a12dfe0be6ede4e133392e528441e67_51152088.capture4.jpg

  9. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    The link doesn't work.

  10. brian7997
    Member
    Posted 1 year ago #

    I would suggest using a text link with a class attached for easy styling. Maybe in the options panel you could select:

    • Define link text
    • Placement: above or below testimonial
    • Upload a image for a button to replace the text.
  11. delatdecatsini
    Member
    Posted 1 year ago #

  12. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, great, thank you guys for the help. I've got a vision now. This makes coding much easier.

  13. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Release 1.5.0 of Testimonials Widget Premium has next testimonials links.

  14. Creatrix
    Member
    Posted 1 year ago #

    This works great so thanks!

    If I wanted to get the previous slide is it just a case of changing the jquery around?

  15. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Yup, but also adding some further HTML to have separate previous/next links.

  16. azaj_00199
    Member
    Posted 1 year ago #

    can anyone help me to put bullet navigation button above testimonial widget plugin in slider urjuntly

  17. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    For help, please submit a new support issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic