Forums

[resolved] PHP cycle values to alternate a css class? (3 posts)

  1. jwack
    Member
    Posted 2 years ago #

    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.

  2. dor
    Member
    Posted 2 years ago #

  3. jwack
    Member
    Posted 2 years ago #

    Thank you, this is just what I needed. Works great!

Topic Closed

This topic has been closed to new replies.

About this Topic