I am modifying the theme TwentyEleven.
In index.php there is the loop which accesses content.php template:
<?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
The trouble is that I need different formatting (different classes) for odd and even posts. How to do this?
My only idea is to remove content.php and insert the code directly to index.php with variable $i counting the position in the loop (by ++$i). But that's bad.