If your theme uses post_class()
to generate post classes you could try. i’m not 100% sure how it will handle pagination b/c i don’t have enough posts on my local install to test it out
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | add_filter('post_class','wpa_44845'); global $current_count; $current_count = 1; function wpa_44845( $classes ){ global $current_count; if ($current_count %3 == 0 ) $classes[] = 'special-class'; $current_count++; return $classes; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.