Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to move adminbar links to sidebar?


calvinhsu
Participant

@calvinhsu

@acaps2007
What I’ve found finally:

(It’s based on this article:
http://easyoutsource.com/blog/how-to-code-a-custom-adminbar-in-buddypress/)

So if you just set your adminbar to be hidden in css rather than completely disable it in the wp-config.php, you could use to call the notification menu.

If you’ve completely disabled adminbar, then use the following code instead(it’s copied from bp-core-adminbar.php):

<?php
global $bp;

if ( !is_user_logged_in() )
return false;

echo '<li id="bp-adminbar-notifications-menu"><a>loggedin_user->domain . '">';
_e( 'Notifications', 'buddypress' );

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

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

if ( $notifications ) {
$counter = 0;
for ( $i = 0; $i < count($notifications); $i++ ) {
$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>

<li></li>

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

<li><a href=&quot;loggedin_user->domain ?>"></a></li>

<?php
}

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

And as I have found out, the js effect (what you called the “mouse over” effect) is dealt automatically by bp-themes/bp-default/_inc/global.js

In my case, I’m building a child theme of bp-default, so I don’t have to worry about js, just copy and paste css codes from bp-themes/bp-default/_inc/css/adminbar.css and adjust selectors accordingly.

If you are not building a child theme of bp-default, then maybe you can try search in the global.js and make some copy and past.

Good luck !

Skip to toolbar