Support » Themes and Templates » Style Every Other Excerpt

Viewing 1 replies (of 1 total)
  • you probably need to edit archive.php, find the div that contains the excerpt, and give it an extra alternating class;
    for instance:

    <div class="post <?php echo $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; ?>"><?php the_excerpt(); ?></div>

    your theme might have a different html structure.

    for instance, add these styles to style.css:

    .post.odd { background: #123456; /* and any other styles you want*/ }
    .post.even { background: #654321; /* and any other styles you want*/ }

    if your theme already uses the .odd or .even classes, then you need to modify the above.

Viewing 1 replies (of 1 total)
  • The topic ‘Style Every Other Excerpt’ is closed to new replies.