Skip to:

*seamless* wordpress integration

  • Hiya all,

    My question is this. How do I integrate bbpress into wordpress so that it all looks like the same site? Eg. Just like here on there is a “Forums” tab and the forum is opened seemlessly into wp like any other page (but without all the sidebars).



    p.s. I need to do the same trick to zenphoto gallery. Would it also work?

Viewing 25 replies - 1 through 25 (of 68 total)
  • Most of the *seemless* integration is really done by creating a template in bbPress that looks the same as wordpress using the existing theme and modifying the CSS style sheet to be the same as your wordpress theme. There are people that have managed to get bbPress inside their wordpress theme, but I only know of those that have failed and will wait for them to tell you how they did it.

    If you copy your /bb-templates/kakumei/ folder to your desktop and then play around with changing the theme. Most people edit the style.css, header.php, footer.php, front-page.php for starters. Then just create a new folder on your server root of /my-templates/ and then upload the files to a new folder /my-templates/mytheme/ or whatever. Then activate that theme in your admin area.

    The way bbPress works is that it will use the files from your new template and the original theme files if it doesn’t exist. That way, if you make a drastic change to any file and you want to start over, just delete that file from your template folder and it will use the original again.

    There are a few threads in this forum where people have gone further into detail, but that is how this site is created and others like mine with and looking the same even though they are on different servers.

    Hope that helps.




    The way I have integrated the two over at is by editing the bbPress template so that it calls the WordPress headers instead of the bbPress ones.

    I presume that you have installed both WordPress and bbPress, and that you have integrated their user databases and installed the required plug-ins as outlined at .

    So, if you now go through the template files for your bbPress installation, you will need to replace all instances of “<?php bb_get_header(); ?>” with the WordPress command “<?php get_header(); ?>”. The same thing goes for the footers, so you change all instances of “<?php bb_get_footer(); ?>” to “<?php get_footer(); ?>”.

    However, in order to get that to work properly, I have also edited my WordPress template so that the (WordPress) header and footer files contain everything except for the actual content that is going to be shown on the page. In other words, all the “container” DIV-elements and such are opened in the header and closed in the footer. While this is perhaps not absolutely necessary, it makes your life easier.

    Finally, I use a boolean check in the WordPress header to see whether I am serving a bbPress page, and modify the header information accordingly. While I currently set the boolean myself by including

    <?php global $forumpage;
    $forumpage = TRUE; ?>

    at the very beginning of each relevant bbPress template page (i.e. those pages that call the header files), fel64 has pointed out that one could simply use a variable that bbPress uses anyway, for example $bbdb.

    I use these checks to modify the title:

    <?php if ($forumpage == TRUE) {
    echo " :.: AKN&amp;I";
    } else ...

    to add the forum feed:

    <?php if ($forumpage == TRUE) bb_feed_head(); ?>

    as well as do some other things (disable Ultimate Tag Warrior’s meta tags for the page, etc.).

    So, it takes a little bit of playing around with your templates, but in the end it is doable without any actual hackery.

    thanks for the suggestions fellas… I will check it out and post back with results.



    Thanks vilimaunula! I’m going to try this as well.

    Honestly, what I really want is for Vanilla Mist to just re-write the Connections theme as a bbpress theme. That would make my life so easy. Someone convince her she needs bbpress on her page.



    Hmm. I took a look at the “Connections” theme by Vanilla Mist, and it seems that the header file in that theme is not used for actual header information, but only for the header DIV. This will make your life somewhat more difficult if you want to integrate your bbPress seemlessly in the manner that I described above.

    my “seemless integration” is coming along quite nicely. but a have a question:

    **obviously when I get my wp header from my bb frontpage.php, I also get the wp stylesheet. would it be better to put a check in the header to see if a bbpress page is being served and disable the wp css, as you mentioned? If so, should I then copy-paste the important stuff from the wp css into the bb css to make the layout uniform?

    Thanks for the help.


    follow-up post deleted. please ignore.



    I would personally just copy the bbPress CSS over to the WordPress one, so as to keep it all in one place. If you want to integrate the two, why then have more than one CSS file? :)

    In reference to Vili’s post, this is how I did the integration for’s install of WP and bbP, however it still left something to be desired. There are occasions where POST or GET content is filtered more than it should be because both systems are running concurrently. Once this gets hashed out, I would have no problem using this for a professional project again, however the amount of work to get around this is currently prohibitive.

    My “Pimp your Press” topic for



    atomAstro — could you elaborate on where POST and GET becomes a problem with this integration? I haven’t yet met with any (that I know), but it would be of great help if you could give a few examples so that I know what to keep an eye on!

    Vili what are you including where to get both systems to run? I did not see that in your post.



    I thought this pretty much explained it?

    Basically, I use WordPress headers and footers throughout both WordPress and bbPress, with my headers and footers containing all the layout design, and whatever is in between only being the actual content to be shown (in the case of a post the post loop, in the case of a page the page loop, in the case of a forum page the forum loop, etc.).

    Vili, sorry for the confusion caused, what I am asking is how you are including the headers. You cannot use WordPress functions without WordPress running. Some where along the line you are including something that loads the WordPress system. Are you using the wp-blog-header.php in the bbPress config.php method from or something different?



    Ah. Yes, I use “require_once(‘path/to/wp-blog-header.php’);” in my bbPress config.php.

    vilimaunula, I used your method or replacing the <?php bb_get_header(); ?> and bb_get_footer. I am not a php buff by any means, but now I am reciving this error:

    Fatal error: Call to undefined function: get_header() in /home/turner/public_html/forums/bb-templates/kakumei/front-page.php on line 1

    Line 1 is the line I replaced, I’m just wondering why it has a promblem with it. I made sure I had the


    set in my config.php.

    The only thing I might be doing differently, is that I have my bbpress in a sub-domain. I also tryed installing in a folder on primary domain, and I ran into the same problem.

    I’m using the Subte “Subvert” theme:

    Any ideas?




    Just to make sure, you don’t actually use “require_once(‘path/to/wp-blog-header.php’);”, but rather have the “path/to/” bit modified to correspond with the correct folder path to your WordPress installation, right?

    As far as I can see (and I am no real coder, either), somehow your current setup still fails to connect to WordPress, and therefore the WP functions, including get_header, are unavailable to bbPress.

    Mine looks like this:


    am I supposed to use a relative path?

    Thank you,


    Yes! In many cases using a relative path is essential to the require and include functions.

    Maybe it’s like this? You’ll know what I mean, anyway.


    I tryed just about everything, and I kept getting this error:

    Warning: main(home/turner/public_html/ppacp/wp-blog-header.php) [function.main]: failed to open stream: No such file or directory in /home/turner/public_html/ppacp/forums/config.php on line 62

    Fatal error: main() [function.require]: Failed opening required ‘home/turner/public_html/ppacp/wp-blog-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/turner/public_html/ppacp/forums/config.php on line 62

    So, I changed the location to this:


    and now I get this error (something different, yay!):

    Fatal error: Cannot redeclare is_serialized() (previously declared in /home/turner/public_html/ppacp/forums/bb-includes/wp-functions.php:976) in /home/turner/public_html/ppacp/wp-includes/functions.php on line 165

    I’m not an expert, but I think the former worked, but that there’s something else wrong.

    Thanks for your help!


    This is probably a nasty hack, and I hope a better solution comes around soon:

    if (file_exists(‘../wp-blog-header.php’))



    if (file_exists(‘../../wp-blog-header.php’))


    Fixed my wp-blog-header when in the root and when in bb-admin.

    *Edit* Weird cannot seem to get the markup tags to work, why not use standard html tags like in wordpress instead of backticks (‘, ยด, `) too much confusion and none of them works.

    Baldwin, looks like your second error is a good error because it’s loading! I believe that the problem is that WP and BB are not set up to synchronise. Have you got this in your config.php?

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    I changed my config file to this:

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    and to this:

    $bb->WP_BB = true;
    if (file_exists('../wp-blog-header.php'))
    if (file_exists('../../wp-blog-header.php'))

    and in either instance I still recieve this error:

    Fatal error: Cannot redeclare is_serialized() (previously declared in /home/turner/public_html/ppacp/forums/bb-includes/wp-functions.php:976) in /home/turner/public_html/ppacp/wp-includes/functions.php on line 165

    Thanks for the help!


    Remember that the include of wp-blog-header.php should happen in the beginning of the config.php file.

    snakefoot, Thanks!

    I fell kinda stupid, I moved this up to the top and now it works!

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    It still dosn’t work with an absolute path, which means this meathod dosn’t work for subdomains.

    Now that the header and footer work, I’ll follow the rest of vilimaunula’s steps to see if I can get this looking better…

    Thanks for helping a nooob!


    Anouther stuipd question:

    How do I make the title update to the appropriate page?

    When in WordPress the title in the browsers “title bar” is updated with the title of the particular post. In bbPress this isn’t happening. I’m assuming this has to do with the header change, but this topic has the correct title in the titlebar, so there must be some way to fix it.

    If Google didn’t exist I wouldn’t care…


Viewing 25 replies - 1 through 25 (of 68 total)
  • You must be logged in to reply to this topic.
Skip to toolbar