WordPress Plugin: Testimonial Rotator

Posted: November 7th, 2012 by Hal Gatewood

Download

This plugin creates a testimonial and a testimonial rotator custom post type, complete with WordPress admin fields for adding testimonials and assigning them to rotators for display. It includes a Widget and Shortcode to display the testimonials.

It’s uses minimal CSS so that it matches your theme and there are several filters to customize it’s output.

Support

If you need help, please use the forum on wordpress.org
This allows other developers to help you out and will probably get your questions answered faster.

Changing the number of posts

You can set a limit=25 on your shortcode to display a fixed number of testimonials. Currently the widget is defaulted to 5 with the ability to change that number by adding the following function to your functions.php file.

function testimonial_rotator_number_of_posts( $args ) {
    $args['number_of_posts'] = 30;
    return $args;
}
add_filter( 'testimonial_rotator_widget_testimonial_args', 'testimonial_rotator_number_of_posts' );

How to Change the Testimonials Slug

Add the following function to your theme’s functions.php file. Change the return value in the first function to whatever you want your page to be: site.org/praise

function change_testimonial_rotator_testimonial_slug( $name ) { return "praise"; }
add_filter( 'testimonial_rotator_testimonial_slug', 'change_testimonial_rotator_testimonial_slug' );

How to Change the Speed of the Testimonials Widget

Add the following function to your theme’s functions.php file. Change the return value to the amount of time you want in milliseconds.

function testimonial_rotator_widget_set_timeout( $args )  { return 10000; }
add_filter( 'testimonial_rotator_widget_timeout', 'testimonial_rotator_widget_set_timeout' );

Creating Placeholders for your Themes

You have two options for this. You can use the do_shortcode route or call the function directly. Changing the ID accordingly.

echo do_shortcode('[testimonial_rotator id=359]');
if(function_exists('testimonial_rotator') { echo testimonial_rotator( array( 'id' => 359) ); }