How do I customize my testimonial list and widget output

Step-by-step guide

If you want to change the layout of the testimonials, then you can use the testimonials_widget_testimonial_html filter. This filter follows the get_testimonials_html method which is how the testimonial HTML is normally generated. The testimonials_widget_testimonial_html filter works for widgets and lists.

In your theme’s functions.php file, place code similar to the following for the configuration you need.

add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 5 );

function my_testimonials_widget_testimonial_html( $content, $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
    // do stuff… see Testimonials_Widget::get_testimonial_html for default processing
    return $content;
}


Examples