Created
January 23, 2016 05:31
-
-
Save subharanjanm/944f7940d4509483a9e4 to your computer and use it in GitHub Desktop.
`tw_get_testimonial_html_class` hook for alternate css class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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