Info
- 69 posts
- 29 voices
- Started 5 years ago by fabtest
- Latest reply from gerikg
- This topic is not resolved
*seamless* wordpress integration
-
- Posted 5 years ago #
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 bbpress.org there is a "Forums" tab and the forum is opened seemlessly into wp like any other page (but without all the sidebars).
Thanks!
fab
p.s. I need to do the same trick to zenphoto gallery. Would it also work?
-
- Posted 5 years ago #
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 http://trentadams.ca and http://onvertigo.com looking the same even though they are on different servers.
Hope that helps.
Trent
-
- Posted 5 years ago #
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 http://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&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.
-
- Posted 5 years ago #
thanks for the suggestions fellas... I will check it out and post back with results.
cheers,
faB -
- Posted 5 years ago #
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.
-
- Posted 5 years ago #
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.
-
- Posted 5 years ago #
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.
faB
-
- Posted 5 years ago #
follow-up post deleted. please ignore.
-
- Posted 5 years ago #
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? :)
-
- Posted 5 years ago #
In reference to Vili's post, this is how I did the integration for 2Checkout.com'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 2Checkout.com:
http://bbpress.org/forums/topic/1172 -
- Posted 5 years ago #
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!
-
- Posted 5 years ago #
Vili what are you including where to get both systems to run? I did not see that in your post.
-
- Posted 5 years ago #
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.).
-
- Posted 5 years ago #
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 http://bbpress.org/documentation/integration-with-wordpress/ or something different?
-
- Posted 5 years ago #
Ah. Yes, I use "require_once('path/to/wp-blog-header.php');" in my bbPress config.php.
-
- Posted 5 years ago #
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
require_once('path/to/wp-blog-header.php');
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:
http://www.gluedideas.com/Any ideas?
-Baldwin -
- Posted 5 years ago #
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.
-
- Posted 5 years ago #
Mine looks like this:
require_once('http://ppacp.org/wp-blog-header.php');
am I supposed to use a relative path?
Thank you,
-Baldwin -
- Posted 5 years ago #
Yes! In many cases using a relative path is essential to the
requireandincludefunctions.Maybe it's like this? You'll know what I mean, anyway.
/home/turner/public_html/wordpress/wp-blog-header.php -
- Posted 5 years ago #
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:
require_once('../wp-blog-header.php');
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!
-Baldwin -
- Posted 5 years ago #
This is probably a nasty hack, and I hope a better solution comes around soon:
if (file_exists('../wp-blog-header.php'))
require_once('../wp-blog-header.php');
else
if (file_exists('../../wp-blog-header.php'))
require_once('../../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.
-
- Posted 5 years ago #
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' ); -
- Posted 5 years ago #
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')) require_once('../wp-blog-header.php'); else if (file_exists('../../wp-blog-header.php')) require_once('../../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!
-Baldwin
http://www.ppacp.org/forums/ -
- Posted 5 years ago #
Remember that the include of wp-blog-header.php should happen in the beginning of the config.php file.
-
- Posted 5 years ago #
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!
-Baldwin -
- Posted 5 years ago #
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...
-Baldwin -
- Posted 5 years ago #
Also, is it possible to have a "forum" header? a header that would go beneth the wordpress header, but only appear on forum pages?
Thanks!
-Baldwin -
- Posted 5 years ago #
If you have the same code for the header then I think you need some conditional if statements in there to check if it's wp or bb. This isn't really straightfoward I'm afraid, but then I'm in the dark here (haven't done it myself) so perhaps it is and I don't know about it.
-
- Posted 5 years ago #
My header title tag reads like follows, I think you can modify it to fit your setup:
<title> <?php if ($forumpage == TRUE) { bb_title(); echo " :.: AKNI"; } else { ?> <?php wp_title(' '); ?> <?php if(wp_title(' ', false)) { echo ' :.: '; } else { echo "AKNI: "; } ?> Akira Kurosawa News and Information <?php if (is_utwtag()) { echo ': '; UTW_ShowCurrentTagSet('tagsettextonly'); } ?> <? } ?> </title>The last condition with UTWTAG is for the Ultimate Tag Warrior plugin -- remove it if you don't use it.
To see how the title works across the site, I think it's easiest if you just visit http://akirakurosawa.info/
-
- Posted 5 years ago #
AHHH
I've copied what you have above, and modified it slightly (to match my site), but I am not getting updated titles on topic pages like:
http://ppacp.org/forums/topic.php?id=1&page&replies=1I'm assuming this has something to do with the templete files for bbpress, so I looked at the top of the files and it looks like this:
<?php get_header(); ?> <?php global $forumpage; $forumpage = TRUE; ?>I changed all the files that had
<?php bb_get_header(); ?>from the "kakumei" folder.Am I doing something wrong?
"confused"
-Baldwin