• Resolved jwack

    (@jwack)


    Im trying to do what the title says. Use PHP to alternate a css class each time through a loop.

    <?php while(have_posts()) : the_post(); ?>
          <div class="post" id="post-<?php the_ID(); ?>">
                <div class="post-content ALTERNATE-CLASS-HERE">
                       ---stuff here---
                </div>
          </div>
    <?php endwhile; ?>

    I just need to cycle through 2 classes in the div above. Thanks for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP cycle values to alternate a css class?’ is closed to new replies.