Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP core functions in bbpress?

  • @deities1

    Member

    Is there a way to call BP core functions inside of bbpress?

    I’m trying to display BP avatars in bbpress using <?php echo bp_core_get_avatar( get_post_author_id() ); ?>

    But I get the following error: #Fatal error: Call to undefined function bp_core_get_avatar()

    I get essentially the same error when trying to display the Buddy Bar in bbpress as well.

Viewing 13 replies - 1 through 13 (of 13 total)
  • @r-a-y

    Keymaster

    You need to call WordPress into bbPress.

    Add this to the top of your bb-config.php (right after the <?php line):

    if ( !defined('ABSPATH') & !defined('XMLRPC_REQUEST')) {
    define('WP_USE_THEMES', false) ;
    include_once($_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php');
    header("HTTP/1.1 200 OK");
    header("Status: 200 All rosy") ;
    }

    Then you can use WP/BP functions in bbPress.

    @deities1

    Member

    Deep integration isn’t working for me for some reason … or at least I can’t access BP functions. WordPress functions work fine. (I use get_header(); with success)

    @deities1

    Member

    Already tried it ….

    WordPress functions I add in bbpress work … Buddypress functions don’t.

    @r-a-y

    Keymaster

    Are you running WP or WPMU?

    @deities1

    Member

    WP

    @r-a-y

    Keymaster

    You could perhaps try using wp-load.php, instead of wp-blog-header.php.

    @deities1

    Member

    There are no references to BP inside wp-blog-header.php or wp-loader.php. Which explains why I can’t access the functions.

    @deities1

    Member

    I don’t know why WordPress can access the BP functions but not bbpress though.

    @r-a-y

    Keymaster

    The other option is manually requiring /buddypress/bp-core.php after the wp-blog-header.php line in bb-config.php.

    Not sure what will happen.

    I’ve successfully used the BuddyBar functions before in a bbPress theme using deep integration and it worked for me…

    @deities1

    Member

    Already tried that as well. I’m not able to call ANY bp functions outside of wordpress for some reason.

    @deities1

    Member

    Tried including bp-core-avatars.php as well. Still nothing.

    Anyone have an idea as to WHY BuddyPress functions can’t be accessed outsides of WP even with proper integration?

    @deities1

    Member

    What’s weird as well is the fact that the avatar in my header changes to the avatar from bbpress when I got to the forum.

    Yet the header.php calls bp_loggedin_user_avatar(). How on earth is the header pulling the bbpress avatar when it’s calling the function to get the BP avatar?

    I mean … the header isn’t even part of bbpress yet it’s pulling the bbpress avatar?

    @deities1

    Member

    Just an update … the header was displaying the bbpress avatar because I re-copied the BuddyPress folder and forgot to re-edit the bp-core-avatar.php.

    I still can’t call bp-core directly but I DID get bp avatars to work inside bbpress by using a different buddy press function.

    I simply edited post.php in my bbpress theme directory, Replaced <?php post_author_avatar_link(); ?> with <?php bp_loggedin_user_avatar( ‘width=48&height=48’ ) ?>

    Works perfectly.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘BP core functions in bbpress?’ is closed to new replies.
Skip to toolbar