/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//append odd/even classes to post_class function function oddeven_post_class ( $classes ) { global $current_class; $classes[] = $current_class; $current_class = ($current_class == 'odd') ? 'even' : 'odd'; return $classes; } add_filter ( 'post_class' , 'oddeven_post_class' ); global $current_class; $current_class = 'odd';