Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: CSS Trick – How to style Activity Stream odd and even posts.

you can do it with php and using a child (recommended):

This above the activity stream loop somewhere put this code:

<?php
$style_classes = array('style-a-class','style-b-class');
$style_index = 0;
;?>

Then this inside the li tag that gets looped through for each activity post:

<li <?php $s = $style_index%2; echo "class=$style_classes[$s]"; $style_index++; ?>>

Works great for any wp template not just a buddypress.

Skip to toolbar