Plugin Author
r-a-y
(@r-a-y)
Are you talking about in the BP Notifications Bar? If so, you can’t as that’s how it’s coded in BuddyPress by default.
However, if a user is on their notifications page though (example.com/members/USER/notifications), it should be split up by individual notifications there.
Im just brining the notifications in on a custom template with something like bellow.. I just need to ungroup the follow notifications from this plugin, which seem to be formatted by the “bp_follow_format_notifications” function.. Have messed with it for a while but cant seem to break them out
if ( $notifications ) {
$counter = 0;
for ( $i = 0; $i < count($notifications); $i++ ) {
$alt = ( 0 == $counter % 2 ) ? ‘ class=”alt”‘ : ”; ?>
<li<?php echo $alt ?>><?php echo $notifications[$i] ?>
<?php $counter++;
}
} else { ?>
Plugin Author
r-a-y
(@r-a-y)
You should use the bp_has_notifications() template loop instead.
See:
https://buddypress.trac.ww.wp.xz.cn/browser/tags/2.3.2/src/bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php
Example:
<?php if ( bp_has_notifications() ) : while ( bp_the_notifications() ) : bp_the_notification(); ?>
<?php bp_the_notification_description(); ?>
<p><?php bp_the_notification_time_since(); ?></tp>
<p><?php bp_the_notification_action_links(); ?></p>
<?php endwhile; endif; ?>