Are you saying that you want to move the bbpress-functions.php file into your theme to make it easier to customize the functions already in the plugin??
You can do that, just copy the bbpress-functions.php file into your theme/child theme.
If you want to customize some functionality in bbPress, you can use the hooks and filters provided in the plugin too.
TKServer,
Do you have bbpress installed ? Or you created the forum yourself and now you want to expand your own development by uses some good functions from bbPress ?
Pascal.
Are you saying that you want to move the bbpress-functions.php file into your theme to make it easier to customize the functions already in the plugin??
YES @robkk. Just didn’t want to redeclare the functions. Will that be an issue? If I can pull in whole functions.php then a whole new world will open up.
I see the files
common/functions.php
theme/core… Wait a sec I just found it…
Inside bbpress/templates/default/bbpress-functions.php
So I just call that from my custom page I guess?
@casiepa yes I do. I’m creating an outside of bbpress page which is a threaded forum view with some extra features. I did not create a forum myself, though the thought crossed my mind until I found bbp.
Inside bbpress/templates/default/bbpress-functions.php
yes that one.
You can place a copy of the file right into your child theme and customize it from there.
You can do the same thing for the other files in bbPress too.
Theme Compatibility
I’m doing that with the template files already, which is great. So do I need to call the bbpress-functions.php file with my custom page or will it load automatically?
It should just be like customizing the bbPress templates, placing it in your theme will replace the plugins bbpress-functions.php file.
The catch is I’m creating pages outside of the bbpress framework, so will the functions still work?
Tell me exactly what you are trying to do. It kind of sounds like you just want to borrow code from bbPress and use it somewhere else.
Are you trying to create a function that is related to the bbPress plugin and other WordPress pages??
Yes. Outside of the bbpress framework I made a custom page which shows a threaded version of the forum: http://www.utehub.com/forum-threads/.
I’m adding reply as a modal window in this page, and want to use the bbpress reply DB insert queries for instance. Also will use bbpress new post queries… Sorry it is so hard to explain.
Basically it’s a bbpress forum view with post and reply functions, but outside of the bbpress framework.
After some digging it looks like most of the functions I’m looking to use outside of the bbpress framework are in includes/forums/functions.php and includes/replies/functions.php.
If it is there then that is when you are going to use bbPress hooks and filters. Since I see how you are doing it, only thing I can suggest possibly filtering the topic index shortcode, using a custom template for the layout, and just listing the last few replies right under. I am sure what you are doing is possible though. Try to learn the best you can from bbPress’s code and create the functionality you want.
I’ve got 85% of it working on my dev server. New posts with meta write. Replies write to the db with a couple of the meta fields. Just wasn’t sure ALL that is written to the db on replies. All I have to go by is looking at the db before and after the change. Not exactly the best way.
@tkserver How are you calling the data outside the bbPress framework? I’m trying to figure out how to display a list of the logged-in user’s subscriptions in my sidebar, but I can’t figure out how to get the bbPress loop to work on other pages. It doesn’t even work on the Forum pages, only when I’m viewing the User Profile.
You have to load the bbpress plugin most likely.