Add class based on even/odd
-
Hi all,
I’ve created a new custom post type and want to have these listed on a certain page.
I created a zebra striping for this but obviously this doesn’t work in IE8. How can I dynamically add a class “even” to the posts?This is my code:
<?php $args = array( 'post_type' => 'tarieven', 'posts_per_page' => '50', 'categorie' => 'dames' ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <dl> <dt class="dienst"><?php the_title(); ?><small class="prijs">€ <?php echo get_post_meta($post->ID, 'prijs', true) ?></small></dt> <dd class="omschrijving"><?php the_content(); ?></dd> </dl> <?php endwhile; ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Add class based on even/odd’ is closed to new replies.