Reading This
Integrate PunBB into your WordPress site
I wanted to add a forum to my WordPress blog but everything I came across did not integrate well (design/page continuity, etc.) or was too simple for my tastes… Then I came across a tutorial here (there are a few around, that’s just the one I tripped across). Following the tutorial I had a somewhat more integrated forum…
…where the blood-splatter of our butchery won’t stain anything…
With the lessons learned and the release of PunBB 1.2.15 I decided to see if I could do a better job. Since the first install/integration I had added a css-based navigation menu and some random quotes which did not display when my banner/header was displayed above the PunBB forum.
Annoyed, I picked up the scissors and started running….
Important to this whole process is where I installed PunBB. I chose /wp-content/myforums. If you do choose to install in a different location/path just modify my examples accordingly, however, you may experience problems if you move it outside the ‘wordpress’ directory (YMMV).
Since I didn’t want to re-design or customize PunBB any more then necessary, I used their template system as well as their include/user feature (allows a user to ‘include’ their own PHP scripts/pages).
First I had to massage my WordPress theme’s header.php into 2 files I named head.php and body.php so there wasn’t any DOCTYPE duplication and it would be valid XHTML strict. About now is a good time to copy your header/php file to a place where the blood-splatter of our butchery won’t stain anything.
The following will only work in versions less than 2.3
With 2.3 I had to remove all calls to WP functions.
- Remove all lines (at the top of the header.php file) that refer to
and(as these would duplicate what PunBB 1.2.15 already sends) - Add this in it’s place, right at the top:
(this allows our WordPress functions to be used) - Scroll down to the
(head closing) tag and delete it AND everything that follows through the rest of the file. - Save it as /wp-content/myforums/include/user/head.php
- Re-open the original, unedited header.php file (same one we used above)
-
Delete everything from line #1 all the way through, and including, the
tag - Now save that as /wp-content/myforums/include/user/body.php
- Now open your themes footer.php
-
Scroll down to the end of the file and delete any reference to the closing tags
and