Skip to content

Instantly share code, notes, and snippets.

@subharanjanm
Created January 23, 2016 05:31
Show Gist options
  • Save subharanjanm/944f7940d4509483a9e4 to your computer and use it in GitHub Desktop.
Save subharanjanm/944f7940d4509483a9e4 to your computer and use it in GitHub Desktop.
`tw_get_testimonial_html_class` hook for alternate css class
<?php
add_filter( 'tw_get_testimonial_html_class', 'my_tw_testimonial_html_class', 99, 6 );
function my_tw_testimonial_html_class( $class, $testimonial, $atts, $is_list, $is_first, $widget_number ) {
static $tw_list_count = 0;
if( ( $tw_list_count % 2 ) == 0 ) {
$tw_class = 'tw-even';
} else {
$tw_class = 'tw-odd';
}
$tw_list_count++;
$class .= ' ' . $tw_class . ' ';
return $class;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment