Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: *seamless* wordpress integration


Vili
Participant

@vilimaunula

The way I have integrated the two over at http://akirakurosawa.info/ 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 https://bbpress.org/documentation/integration-with-wordpress/ .

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) {
bb_title();
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.

Skip to toolbar