add odd or even class in wordpress loop using php

You can while loop for add odd or even class in loop.

while ( have_posts() ) : the_post(); 
	echo ($count % 2 ? "<li class='even'>" : "<li class='odd'>");
endwhile; ?>

Share With Friends

Also Read   6 best plugins for speed up the wordpress website

Speak Your Mind


Time limit is exhausted. Please reload CAPTCHA.