Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add wp_admin_bar to a BP theme

  • Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    Just when I get my head around add_action & remove_action, WP3.1 throws something new at me ;-(

    I’m trying to get the wp_admin_bar to show in a BP theme instead of the bp-adminbar. But, for the life of me, I can’t figure it out.
    I’ve found the function that determines whether the wp-adminbar is allowed to show or not, but can’t figure out how to implement it. The function can be seen here starting on line 327:
    http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/admin-bar.php

    Can anyone give me a clue?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Just remove the admin bar:

    `define ( ‘BP_DISABLE_ADMIN_BAR’, true );` in wp-config.php

    Is that what you’re trying to do?

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @gunju2221

    Thanks. The end result is precisely what I’d like to achieve. But I’d like to be able to do it in functions.php so it can be included as a theme option (ie – a switch to select either BP or WP adminbar). Removing the bp-adminbar is easy, it’s calling the wp one afterwards that’s got me stuck.

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    `remove_action( ‘wp_footer’, ‘bp_core_admin_bar’ );
    remove_action( ‘admin_footer’, ‘bp_core_admin_bar’ );`

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    Thanks, but I think your last post was in answer to the last poster’s question in this thread:
    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/show-bp-admin-bar-while-in-wp-admin-only-and-hide-it-in-the-rest-of-the-site/

    `remove_action( ‘admin_footer’, ‘bp_core_admin_bar’ );` effectively removes the adminbar from the backend, but that’s not what I’m trying to achieve.
    I’m trying to replace the bp-adminbar with the WordPress adminbar in a Buddypress theme.

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Well thats just the standard action.

    To replace the bp-adminbar, with the wordpress adminbar, you must remove the bp-admin bar first! :)

    I’m still not completely comprehending what you’re trying to achieve.

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @gunju2221

    Hi again! As I mentioned in my 2nd post: “Removing the bp-adminbar is easy, it’s calling the wp one afterwards that’s got me stuck.”

    Removing the bp-adminbar is not the problem. The problem is in showing the WP bar after removal of the bp-adminbar. Or, I should say: the problem WAS… It turns out the call to display the WP bar is surprisingly simple: `show_admin_bar(true);` So, the following in functions.php efectively replaces the bp-adminbar with the WP version. Now I can create the switch for my theme. Thanks for your help!

    `define ( ‘BP_DISABLE_ADMIN_BAR’, true );
    show_admin_bar(true);`

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Glad you got it worked out!

    Although, I’m pretty sure that if you remove the admin bar via ‘remove_action’ and remove the CSS for admin bar body, it would make the wordpress admin bar compatible, from my understanding the 2 bars were not “incompatible” as much as “clashing”

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.