Add a class to third, sixth, 9th, post
-
I am using this code for displaying posts within a certain category.
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>li show something li
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>
For styling purposes i would like that every third displayed post to have <li class”example”> instead of
li . Something like oddcomment function.Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add a class to third, sixth, 9th, post’ is closed to new replies.