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.
Are you running WP or WPMU?
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.
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?
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.