Skip to:
Content
Pages
Categories
Search
Top
Bottom

Use bbpress functions.php outside of bbpress?

  • @tkserver

    Participant

    I’ve made a threaded forum list which looks really nice. I’ve added a little code to reply to posts but it isn’t writing the meta and I really don’t know what to write in the meta.

    I’m thinking it would be cool to bring in the entire bbpress functions.php to my page to utilize those functions already, rather than writing my own code for things.

    Is that possible to import functions.php and use it outside of bbpress?

    The main functions I would be looking for are posting and replying.

Viewing 15 replies - 1 through 15 (of 15 total)
  • @robkk

    Moderator

    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.

    @casiepa

    Moderator

    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.

    @tkserver

    Participant

    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.

    @robkk

    Moderator

    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

    @tkserver

    Participant

    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?

    @robkk

    Moderator

    It should just be like customizing the bbPress templates, placing it in your theme will replace the plugins bbpress-functions.php file.

    @tkserver

    Participant

    The catch is I’m creating pages outside of the bbpress framework, so will the functions still work?

    @robkk

    Moderator

    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??

    @tkserver

    Participant

    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.

    @tkserver

    Participant

    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.

    @robkk

    Moderator

    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.

    @tkserver

    Participant

    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

    Participant

    @shoelaced

    Participant

    @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.

    @tkserver

    Participant

    You have to load the bbpress plugin most likely.

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