Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] How To Get Notification Count? (Code)?

@danbp

Participant

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++;
			}	
Skip to toolbar