Skip to content

Instantly share code, notes, and snippets.

@subharanjanm
Last active February 16, 2016 11:46
Show Gist options
  • Select an option

  • Save subharanjanm/575f564185d14182a7e3 to your computer and use it in GitHub Desktop.

Select an option

Save subharanjanm/575f564185d14182a7e3 to your computer and use it in GitHub Desktop.
tw_get_testimonial_html_class to add even odd 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