With the redesign of my site I have taken the integration of wordpress and bbpress a step beyond theme integration. This time I wanted to reuse the plugins for wordpress and also have forums showup with wordpress. I received requests from many of you about how to do it. Also the previous post about the integration is sort outdated because of the consequent releases of bbpress.
For the purpose of this article I am assuming that the bbpress installed in a subdirectory of wordpress
File: bbpress/config.php
Add the following code to the top of config.php
define('WP_BB', true);
if ( !defined('DB_NAME') ) {
require_once( dirname(__FILE__) . '/../wp-config.php');
}
Define the following variables.
$bb->wp_table_prefix = 'wp__'; // your wordpress db prefix is
$bb->wp_home = 'http://www.yourwebsite.com';
$bb->wp_siteurl = 'http://www.yourwebsite.com';
File: wordpress/wp-config.php
In this file the last statement is which says
require_once(ABSPATH.'wp-settings.php');
After this statement (before the php closing tag - ?>) add the following statements
if ( !defined('BBDB_NAME') )
require_once(ABSPATH.'bbpress/bb-load.php');
replace bbpress with whatever the directory bbPress is in.
bbPress Plugin: Display Name
This plugin ensures that the name shown is the display name from the wordpress rather than the username.
Download, Upload and activate this plugin in bbPress.
bbPress Plugin: Wordpress Integration
This plugin ensures that your existing wordpress users can log into your bbPress install.
Download, Upload and activate this plugin in bbPress.
Wordpress Plugin: bbPress Integration
This plugin makes suer that the users created in wordpress have valid roles in bbpress.
Download, Upload and activate this plugin in wordpress. After activating this plugin, go to Plugins » bbPress and enter the bbPress database prefix and update.
Theme: Template Integration
Download this file and drop the created directory in your my-templates directory. All this theme does is takes that header and footer from the wordpress theme and uses it.
Note 1: You will still need to add some more css styling for the forum contents.
Note 2: This theme does assumes that the footer and header will bring in any sidebar that you need automatically. If thats not the case you will have to add get_sidebar(); wherever needed.
Enjoy the bliss
That should do it. Now all your plugins and functions in wordpress should work with bbPress and also all the functions in bbpress should work with wordpress. You can all any of the bbpress functions in the wordpress themes.
I think that bbconfig also needs settings to force the use of certain cookie names….
Also, folks using Ultimate tag Warrior should make sure they are using the latest version of UTW to ensure no function conflicts.
You don’t need that if the fourm is hosted in the subdirectory of the wordpress install. If its in a directory - yes that needs some fiddling around. That’s probably a sticking point in many installs. I’ll write about it soon enough I suppose :)
Thanks for the tip.
I think you are doing great work.. your tutorials are very easy to follow and a step in the right direction for BBpress and what users really want it to do… but I am wondering about the CSS part.. do I edit the one in the Themepress Directory or in the WP theme?? It also shoves my SIDEBAR to the bottom which I am also trying to figure out… Can you restrict the width of the embedded BBpress forum somewhere??
Take a look.. so far
WP http://www.djvibe.com/content/
BBP http://www.djvibe.com/content/forums
PS is there a way that we can make Themepress use the CSS for the WP theme??
Thx ;)
Thanks! I’m glad I could help
you edit the one in the wp theme.
to restrict the width of the forum just add the css for that in the wp theme css itself. if you want to keep them separate, just create a new css for forum and import it in the wp theme css.
Themepress does use the css in the wp theme.
I just upgraded to WP 2.3 and had to turn off integration between BB and WP. At the moment, one cannot require wp-config.php from bbpress/config.php - you get the white screen of death. Any ideas?
Actually i haven’t yet tested the tutorial on 2.3. I’m planning to do that soon and i’ll update the tutorial or post an update.
Putting
define(’WP_BB’, true);
if ( !defined(’DB_NAME’) ) {
require_once( dirname(__FILE__) . ‘/../wp-config.php’);
At the top of my config pages makes my forum page blank
thanks for the reply… Ill try that… Cheers!!
Can I worship you and call you goddess? You just made my life so much easier! Thank you for all your hard work and time! You are in my favorites forever.
you can worship me but you may not call me goddess! NO you may not!
you may call me god though.
that reminds me I should write about myself somewhere on my website! :)
My apologies, great one. :D I wanted to point out though that there is something about the Use Display Name plugin that is not allowing me to administrate my forums (add new or delete forums). I haven’t quite figured out what the conflict is yet but I’m looking into it.
Thanks Adi, yours is the only site that has a sensible, easy-to-follow tutorial on how to integrate bbPress with Wordpress. Cheers.
I’m glad it was helpful..
Just had a try.. think I am getting there.
I have an error message though
“Fatal error: Call to undefined function: get_header() in /home/xxxxxxx/public_html/forum/my-templates/ThemePress/front-page.php on line 1″
Will it change the design to the active WP theme?
This happens if you have not included in your bbpress/config.php
‘require_once( dirname(__FILE__) . ‘/../wp-config.php’);’
if you have wordpress anywhere other than parent of the bbpress directory then point to the wp-config.php using absolute path.
Great work and nice tutorial. I got it working but when I tried to post on my wpress I got the following error. Any idea ?
Warning: Missing argument 2 for bb_bozo_pre_post_status() in /home/robertd1/public_html/**/forum/bb-includes/bozo.php on line 173
Warning: Missing argument 3 for bb_bozo_pre_post_status() in /home/robertd1/public_html/**/forum/bb-includes/bozo.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/robertd1/public_html/**/forum/bb-includes/bozo.php:173) in /home/robertd1/public_html/**/wp-includes/pluggable.php on line 390
Commented out the site directory :P
does this error go away if you remove the integration?
Yupe , it does go away. I’ve just removed the integration. Sigh it was really a sad I wanted to integrate it. Error seems to happen when I try to
- save a post
- publish a post
- logging out from bbpress
I’m also using WP 2.3 and BBPress 0.83 ( Desmond ). Any recommendation ?
It always an error msg that has to do with bozo.php too… if that helps.
Thanks Aditya.
Andrew
the first step to debug is disable all the plugins..
then intergrate pure wordpress with pure bbpress..
if that’s not working then then there then we need to find the call to bb_bozo_pre_post_status without the other parameters..
if you are not using the bozo features.. deleting the bozo.php will fix this problem..
let me know how it goes
I’ll give it a try now and post back. The last time I did tried on a clean install. Only Wordpress and Only bbpress with no plugins on either site.
Aditya,
Still crashing on a clean install. No other plugin than the ones that you asked to install. Crash is happening at wp-admin/post.php
Warning: Missing argument 2 for bb_bozo_pre_post_status() in /public_html/smi/forum/bb-includes/bozo.php on line 173
Warning: Missing argument 3 for bb_bozo_pre_post_status() in /public_html/smi/forum/bb-includes/bozo.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /public_html/smi/forum/bb-includes/bozo.php:173) in /public_html/smi/wp-includes/pluggable.php on line 390
where smi is the folder where my wordpress is installed
Deleting the bozo.php doesnt seem to work too. Cause now there are files that are looking for bozo.php and random crashes whenever places that calls bozo.php
Yes, I’m having the same problem as Andrew - a shame, because what you’ve done is brilliant! I’ve been looking everywhere for this solution.
If it’s any help, I removed the integration and the problem went away when I removed the following:
if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’talk/bb-load.php’);
Ben,
Definately agree with Ben , Aditya’s work is absolutely brilliant. The only one that I know of that works ‘almost’ perfectly. :P
Which integration did you removed ? Both wordpress and bbpress integration ?
Andrew
i appreciate your comments guys..
im working on the fix right now..
for some reason i dont know why i cannot reproduce the problem.. i have tried two fresh installs on windows and mac.. both work fine..
but here is a short cut fix to the problem.
go to bbpress/bb-settings.php
line 132 -
require( BBPATH . BBINC . ‘bozo.php’);
comment this line off..
Also if you are comfortable, i’d like to see both your config files as is - just wipe off passwords and stuff
Yes, commenting that out worked for me. I’ll send you the config files tomorrow. Thanks again!
I am having the same problem to and commenting did the trick any idea what are we loosing when we comment?
When you comment that row you are loosing the bozo feature.. if you want to know what is bozo.. that means that you probably are not using it and don’t need it :)
Thanks Aditya for the quick reply and who cares about bozos anyway :)
I have just noticed that if i add
if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’forums/bb-load.php’);
in my wp-config.php to integrate i’m loosing the static homepage functinality in wordpress 2.3 :(
can i safely omit this?
Trying to track down the issue
bb-load.php is calling config.php
and config.php is calling bb-settings.php
oops i’m sorry but something went wrong only 1/2 my post went thru …
Trying to track down the issue
bb-load.php is calling config.php
and config.php is calling bb-settings.php
the latter (bb-settings.php) is causing the error if i comment this one all goes ok but I still think that commenting out
if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’forums/bb-load.php’);
from wp-config.php might be safer
`if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’forums/bb-load.php’);`
you need this only if you want to call bbpress functions and plugins from wordpress.
eg.. if you look at my wordpress homepage i have displayed the bbpredd forum discussions there. if you remove that line you wouldnt be able to get that.
i am interested in why that is happening though.. because of the if clause it should get into recursive mode..
thanks for bringing this up
I see thank you for the clarification
but then you are using static page and integration is my case “unique” or you are not using wordpress 2.3?
Getting….
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/xxxx/public_html/forums/bb-admin/themes.php:2) in /home/sites/xxxx/public_html/wp-includes/pluggable.php on line 391
any ideas…?
ta
Dave
nm me being rather silly :S
I was doing all of this tutorial, but when I try to login on my forum with my WordPress User, I have some error message
This username does not exist. Register it?
What should I do to make integration works?
Please help me.
Thanks
I followed your instructions to the letter, but I am new to PHP, CSS etc.
All instructions you wrote are very clear and everything worked the first time.
My WP theme uses two sidebars, and I thought the easiest way to add them to BBP would be to append left sidebar to the header and right sidebar to the footer. I added [code]
[/code] to the ThemePress/header.php and [code]
[/code] to ThemePress/footer.php
However they are not being rendered. I had to go and edit every file in the theme, such as front-page.php, forum.php, post.php, topic.php… Can anyone explain why editing header and footer doesn’t work? Is there an easier way?
Also, ThemePress doesn’t have little login boxes that regular BBP themes have. Am I correct to think that since now BBP and WP are integrated, WP logins will be used for both applications? Thus separate login on BBP is no longer required. Right?
You can take a look at what I’ve got so far at http://www.MaxiMovieBlog.com/ and http://www.MaxiMovieBlog.com/forums/
I only added side bars to main page and topic page so far. Please let me know if there’s an easier way to add sidebars - through headers, perhaps.
Hey, I suppose I can modify the original WP theme to add sidebars ALSO from header and footer and get rid of all duplicate code in the rest of the pages… After all, I have customized my theme quite a bit already so there’s no going back to the original theme or ever upgrading it to a new version when theme author releases one…
…for some reason my code blocks weren’s displayed… Here they are:
Header.php:
Footer.php:
Dang.. didn’t display again. I suppose I need to escape all of them…
Header.php:
<div id=”content_box”>
<?php include (TEMPLATEPATH . ‘/l_sidebar.php’); ?>
<div id=”content” class=”posts”>
Footer.php:
</div>
<?php include (TEMPLATEPATH . ‘/r_sidebar.php’); ?>
</div>
Never mind. I actually implemented the changes I was talking about, but inetad of editing ThemePress’s header and footer, I moved the code for left and right toolbar to the header of footer, but of WordPress’s theme!!!
Now BBP is fully intergated and displays wthin WordPress blog.
The last problem I need to solve is that th forum uses WP theme’s CSS and appears centered horizontally and vertically in the page.
Could you please look at the original website at http://www.MaxiMovieBlog.com/ and then at http://www.MaxiMovieBlog.com/forums
You’d have to scroll to the middle of the page to see the forum… Please let me know what should I do with the CSS to make the forum look normal. Should I just append ThemePress CSS to my WP theme’s CSS?
Note that the forums have not been linked to from the main page yet and not been submitted to the search engines until I fix the formatting.
Alas I simply appended CSS from ThemePress to the CSS of WordPress. There’s no overlap in style definitions so it should be OK.
Now the forum looks fine: instead of centered unformatted text it displays nice tables.
But I am not out of the woods yet. The table is too wide and messes up the DIV elements: instead of sidebar-forum-sidebar, all DIVs are stacked up on top of eachother. I need to edit the width of the forum table in the CSS…
Does anyone know how to limit the width of the forum pages to, say, 500 pixels? Whatever I do, they seem to always take 100% width of the page and mess up the formatting,
Oh, crap! OK, I am using Cutline theme, slightly modified.
After I followed your instructions, particularly about adding bb-load into wp-config.php,
if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’bbpress/bb-load.php’);
some pages stopped working.
The Contact Us page was not rendering anything following “Contact Us” header, and sitemap was rendering the page only until it hit php scriptlet that displayed all the posts. I spent last 10 hours trying to figure out where the problem was. I checked PHP error log (nothing), uninstalled and reinstalled all plugins, theme etc.
The pages began to work normally again once I commended the above two lines…
What do you think is the problem? Am I out of luck and it’s not that easy to intergate forums with WP after all?
the above lines are only used if you want to use bbpress functions in wp.. if you dont need that you can comment those out.. you still will have a integrated bbpress and wordpress.. you forum users will be able to log into wordpress and vice-versa..
about the actual problem. I’m not sure why that would happen..
ideally you should integrate with the default theme of wordpress and bbpress and no plugins. and once everything is going good add on plugin at a time and then theme.. that way you’ll know what the trouble is.
let me know how it goes..
Interestingly when I integrated WP and BBP on my local Windows machine it worked fine, but when I hosted on to the server (goDaddy), the site kinda crapped out…
Can people with problems mention the OS, maybe the path settings could be an issue??
P.S. Still need to check on my Ubuntu VM.
Hey thanks varun..
that might explain why i could not replicate the issue.. thanks for the heads up..
i’ll check on mac and linux..
Hello!
I followed strictly this tutorial. It was easy to do this way but unfortunatelly I get an error. I did it on a fresh WP and as well fresh bbPress installation. No theme and no plugin was activated in WP, in order to avoid any conflict.
Aparently everything works fine, but finally when I try to save a topic or a post, I get always an error message:
“The requested URL /bbpress/topic/again- was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”
It’s interesting that I do not have that ‘topic’ folder on bbpress folder and even I create one with 777 permissions nothing is changed.
I will appreciate a lot and advice.
Mihai
I think the error is unrelated.. there should be a line in the config.php which sets value for $bb->mod_rewrite.. set that to false. that should get you going.
You are really so good! I did the shift from ’slug’ to false and it works! THANKS VERY MUCH!
I’m back… I observed that I have the ‘bozo’ problem and I wonder if I can keep using the complete integration.
Have you ever found any solution to this bug?
Appreciating at maximum your contribution,
Mihai
$bb->wp_home = ”; // WordPress - Options->General: Blog address (URL) // Example: ‘http://example.com’
$bb->wp_siteurl = ”; // WordPress - Options->General: WordPress address (URL) // Example: ‘http://example.com’
what is the difference b/w wp_home and wp_siteurl. if they r same then why confuse us with 2 entries. pls can u tell me regardign this
if i have a wordpress blog at example.com and my forum at example.com/forums , what should be the values.??
is it possible to display new posts inside wordpress.. how to make my bbpress look similar to my bbpress?? any theme that works out for both
Hi!
I’m trying to make it work under Wordpress 2.3 but without luck.
Whit this line added to wp-config.php
if ( !defined(’BBDB_NAME’) )
require_once(ABSPATH.’forum/bb-load.php’);
the whole site stop working
(Fatal error: Cannot redeclare class CachedFileReader in bora.la/forum/bb-includes/streams.php on line 163)
if i remove from wp-config.php
the error is still there in bbpress.
if i remove the changes made to the bbpress/config.php
define(’WP_BB’, true);
if ( !defined(’DB_NAME’) ) {
require_once( dirname(__FILE__) . ‘/../wp-config.php’);
}
i get this error while using the ThemePress template
Call to undefined function get_header()
but i thing this is normal becouse there is no link between the WP and BBP.
Is there a way to include bbpress as a subpage of wordpress?
Like i create a page within WP that is based on a template that load the BBpress?
i’m also getting the same error, fatal error due to Cachedfilereader; where the page is shown empty!
Aditya, what you did here is exactly what i have been looking for. can you help look at what further tweaks needed to make this run on wp2.3+ ? thanks so much.
Sorry but I just had to undo everything I did with instruction from your tutorial. All it did was cause a bunch of errors and warnings making posts to WordPress. The instructions on the official bbPress website worked just fine. If it ain’t broke…don’t fix it!
I’m going to take a shot at this in the coming weeks.
Which version of Kakumei did you use as a base? I plan to do a big diff to see what changes you made.
Note, the base Kakumei theme has changed since you made your modifications.
See diffs here.
http://trac.bbpress.org/changeset?new=%2F%40971&old=%2F%40951
sorry guys.. my schools been taking much more time than i imagined…
i’ll try to get to this first thing i get some breathing space..
bear with me.
Warning: Cannot modify header information - headers already sent by (output started at /home/balitrav/public_html/wp-config.php:48) in /home/balitrav/public_html/wp-includes/pluggable.php on line 391
i get this error when do post or any other post. i use the newer wp.
thanks
Hi, just wanted to thank you for your notes on integrating functions between both wp and bbp. I saw the tutorial on the bbpress site, and it said nothing about getting bbpress functions working in wp, so you really saved me!
Thanks again :)
I was able to install your plugins and the transition looks good from WP to BBpress.
Only problem is that the WP site has 2 right sidebars, and I don’t know how reproduce that when a user goes to the bbpress forum section - it takes duplicates the functions in the header and footer. What is the easiest way to get around that so I can get my sidebars back for the forum sections?
Hi
I’m using WP 2.3.3 and BBpress 0.8.3.1 and I’ve managed to get everything to work except that I can’t access the BBpress admin at bbpress-folder/bb-admin
So far as I’ve goten it seems as it compares the WP-user with the authorities among the BBpress users but I can’t find out where that happends.
Do you have any ideas?
I followed your instructions and the template looks good.
However, on the forum, all page titles say “My site blog” and do not change - why is this happening?
has anyone used this method, or any other successfully when connecting installs on different domains? Say wordpress is on http://www.domain.com and bbpress on forum.seconddomain.com?
so far everything I’ve try does not work. it seems like there’s something i’m missing.
I’ve try’d editing the cookie domains to match but that disables log in on one or the other. Any help would be loved.
thanks
Hi, I’ve installed the bbpress 0.8.3.1 version into the wordpress v2.3.2 directory.
I’ve followed your instructions for integrating bbpress in wordpress, and it works fine (the get_header(); and get_footer(); are working from the template which is very convenient !!)
But there is a major issue when you try to localise bbpress by adding the .mo file into bb-includes/languages/
and add: define(’BBLANG’, ‘fr_FR’);
into config.php file
I’ve the Fatal error: Cannot redeclare class cachedfilereader in E:\wamp\www\hyporec\rs_next2\bbpress\bb-includes\streams.php on line 163
After many hours of research and tests, the problem seems to be due that there is a confict between wordpress fr mo file and the bbpress one.
Please how can I solve this issue ?
Many thanks in advance for you help
Hi Aditya
I used this all as you gave.
It was giving me error when i used to save pages in WP.
something related to bozo.php.
i have set error reporting to 0.
do you think i should do something better ?
Regards
Mihir
@mihir
the problem with the bozo error is that wordpress and bbpress use some filter names which are conflicting.
at this stage the only way to fix this
http://www.adityanaik.com/integratepress-part-i/#comment-7894
try doing that..
@Lee
that is because you are using the same hear file as wordpress.. if you want to use a different heading in forum you will need to write a code to do that seperately.
Wow, phenomenal. I’ve almost got it useable. However, I just need a little help editing the CSS. Right now, I’m using the awesome Vistered-Little theme (http://windyroad.org/software/wordpress/vistered-little-theme/), and after following your directions, I get bbpress using that theme, but all of the forums elements are transparent, meaning the text is nearly unreadable over the background image.
Please take a look at my forums page here: http://www.thewisemanfamily.org/wp/bbpress/
I’m no stranger to editing a CSS file, but I have no idea what tags/classes/etc. I need to edit in the ThemePress’s style.css file to make this text readable.
I’d greatly appreciate your help!
Thanks again for all of your work with this!
@adam
in this case it will take much more than just css edit.. the template will need to be modified to add the distinct back box around the forum..
also i suspect that you will need a new background image which is wider than the one already there..
Hi Aditya
thanks
this sounds great. I will try it.
I thought it was better to ignore error for trial :)
will change code as per direction.
btw : Great work bro ..
Thanks A Lot
Mihir
@tfab
i have not worked on localizations.. but if you are creating the mo files i think just create the wordpress and bbpress mo files together and put the mo file in wordpress and do not initialize bbpress language seperately.. that i think should do it.
@jelthure
i dont see a reason why it should not run.. what is the error you are getting?
@tfab
I found the solution to the localization problem.
You can’t load 2 localization files (Wordpress + bb¨Press) because there is a conflict.
You can however put all the translations in one single .mo file and load it in WordPress. This way you don’t need to load the bbPress localization file.
I created the merged .mo file using the GNU gettext msgcat utility, and then poEdit to create the new .mo file
It works fine, I get all the translations in WP and bbP
That was tricky. Took me 3 hours to figure out but you put me on the right track by diagnosing the locale problem! Thx!
(posted this solution on the bbPress forum as well)
thanks ydubois for the solution..
Wordpress 2.5, BB-Press .9.0.1 and your theme integration. Its KILLIN ME. :P If anyone can help please do so. And yes I’ve checked for spaces/lines before/after my php tags in both of these files, there are none..
Warning: Cannot modify header information - headers already sent by (output started at /var/www/virtual/mywebsite/forums/bb-config.php:1) in /var/www/virtual/mywebsite/wp-includes/pluggable.php on line 689
:) dude!
first integrate wordpress and bbpress.. forget the theme integration. once you are done with the user integration - login logout and stuff with wordpress and bbpress’ default themes.. then move onto theme integration.
i am trying out the integration for those version right now.. will let you know the results..
Hah. The integration works. I think. ;P I don’t know. I can’t hit admin so I renamed the integration theme folder to push it to default to one of the new ones. No change. It authenticates across to the forums read/etc is fine. Its just when I post or attempt to login to admin where it chokes. I posted the same error msg on the bbpress forums. Thought you’re worldly integration experience might be able to help :P :)
Woot. Let me know
Chad
completely rebuilt my bb-config.php file. All is good now. No clue why it was jacked.
Chad
thanks for letting me know. I integrated my forums and its worked fine. so i was scratching my head :)
cheers!