Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,841
- How-to & Troubleshooting
- 129,887
- Creating & Extending
- 25,913
- Requests & Feedback
- 9,553
- Third Party Plugins
- 9,834
- Showcase
- 3,316
- Ideas
- 1,404
- Miscellaneous
- 9,183
-
Try this
if ( $notifications = bp_notifications_get_notifications_for_user( $user_id, $format = 'string' ) ) {
$counter = 0;
for ( $i = 0; $i < count($notifications); $i++ ) {
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
echo '<span ="'.$alt.'">'. $notifications[$i] .'</span>';
$counter++;
}