Last active
February 16, 2016 11:46
-
-
Save subharanjanm/575f564185d14182a7e3 to your computer and use it in GitHub Desktop.
tw_get_testimonial_html_class to add even odd 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