Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP core functions in bbpress?

  • 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

    @r-a-y

    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.

    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)

    Already tried it ….

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


    r-a-y
    Keymaster

    @r-a-y

    Are you running WP or WPMU?

    WP


    r-a-y
    Keymaster

    @r-a-y

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

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

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


    r-a-y
    Keymaster

    @r-a-y

    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…

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

    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?

    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

    @deities1

    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