WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've a buddypress website and what I want is to show in the frontend the notification that buddybar have in the backend, but only the notification not all the buddybar.

basically set the notification like facebook....

how can I do that?

share|improve this question

closed as off-topic by toscho Aug 2 '14 at 20:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Hi, Manuele, welcome to WPSE! Please, try to add more details to your Question, a screenshot, relevant code (if you can locate it). Take a look at this guide: How to Ask. – brasofilo Feb 1 '13 at 12:18
Hi not sure if this is what you are trying to do, if you go to smeak.com you can see it at work, we split the notifications intro 3, and into a custom toolbar we built for the network. Let me know to see if we can help – user28950 Mar 14 '13 at 20:27

Put the following code in your functions.php. If you want a demo i can show you.

// my custom notification menu www.cityflavourmagazine.com

function my_bp_adminbar_notifications_menu() {
global $bp;

if ( !is_user_logged_in() )
    return false;

echo '<li id="top-notification">';
_e( 'Alerts', 'buddypress' );

if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
    <span><?php echo count( $notifications ) ?></span>

echo '</a>';
echo '<ul>';

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] ?></li>

        <?php $counter++;
} else { ?>

    <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'You have no new alerts.', 'buddypress' ); ?></a></li>


echo '</ul>';
echo '</li>';

Use the following code to call it anywhere you like. Note: you can amend the above code as you like

<?php my_bp_adminbar_notifications_menu()?>

share|improve this answer

look at this page http://www.colegeissinger.com/blog/2012/12/04/get-buddypress-notifications-count/ where he explains like below:

Put that function into your functions.php file

    function cg_current_user_notification_count() {
    $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), 'object');
    $count = !empty($notifications) ? count($notifications) : 0;

    echo $count;

in front end use,

Notificaitons : <?php cg_current_user_notification_count(); ?>
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.