I agree the lack of basic, getting started documentation for CURRENT bbpress is pretty frustrating. Just a basic roadmap of how the plugin works and which template and functions files are the key ones for making basic changes would be very helpful. A high-level technical overview of what is what and where.
For example, does anyone know which template is being rendered when I go to my-site.com/forums? More importantly, can anyone give me the rosetta stone so that I could figure something like that out myself at a glance without having to read through a ton of code?
The answer to my question about which template is being rendered (at least in my case) was `page.php`.
That’s `page.php` from your theme.
So if you, like me, want to do things to the main template in which the bbpress forums are housed, you can use `page.php`.
If you, like me, want to do things to that template ONLY for bbpress stuff, but not for other “pages” in your site, you can use the php function `is_bbpress()` in that template to render conditional html based on whether it is a bbpress page or not.
This seems like amazingly basic and obvious information that I was only able to discern by gritting my teeth and putting bbpress into the text editor and reading through A LOT of code. If this information is documented somewhere easy to find, please enlighten me so that i can perform the requisite face palm. If it’s not, why not?
This is untested by me, but digging through some more code, it looks like you might be able to create a custom home-base template for your bbpress forum by copying the original `page.php` into a new file and naming it any of:”
`’plugin-bbpress.php’,
‘bbpress.php’,
‘forums.php’,
‘forum.php’,
‘generic.php’`
If it’s not, why not?
The honest truth is that once most people learn what they need, they never go into the bbPress codex and make a page to share their knowledge.
I made a codex page describing what I learned so far. I don’t know if what I wrote is anything like a best practice, but it worked for me. It would be great if those more knowledgeable would correct and expand on it.
https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
I don’t know if what I wrote is anything like a best practice, but it worked for me
Anything is better than nothing. We can always iterate on anything you create later. Thanks for putting that up!
I’m assuming that if I want to override the template files inside the plugin directory, I need to place a file of the same name (ex: archive_forum.php) inside the bbpress directory within my theme folder.
So where do custom bbpress functions go? My theme’s functions.php?
Custom bbPress functions can go into your functions.php file, but I prefer to create a custom functions plugin.
Ironically, the use I plan to make for bbPress is to create a model for “Living Documentation” as described in the book “Specification by Example” for various types of software projects.
I am new to the Open Software model after having spent 30 odd years working within the “private” model. I see clear sustainability problems if users behave like typical users: demanding more and more from people who are being paid a fraction they are in the private model. Something has got to give. The proliferation of modules reflects current design methods of keeping each one fairly small/simple. The problem with that approach is that it indeed requires key overview docs including use of things like stepwise refinement and UML docs in order to obtain a cohesive grasp of the whole. As in baseball, “you can’t tell the players without a program!”
wordpress at least has several “apparently good” books to explain the development paradigm. bbPress users are not so lucky.
It is a very big job to create this very useful software and we should be more appreciative to those who have accepted this challenge – consider how long it would take any of us to write the volume of php code or even do the design work!
I think Mr. Jacoby is correct – if everyone who ran down a problem bothered to leave a little “map” or narrative of his journey we might get a better picture of how this thing works. The only problem I see with that is too many requirements: 1) user has to be able to ferret out the problem; 2) user has to be correct; 3) user has to be able to write carefully. There may be others requirements as well.
Ideally, we need better docs that reduce the abstractions presented to us in the form of raw code. It seems to me that the community needs to decide that bug fixes and new features should wait until the overall design can be made clear to nearly all of us.
`/forums` is an archive of all forums, different from a page using the `page-front-forums.php` template with a slug of `/forums`. Is there a way to target the forums home without using the `page-front-forums.php` page template? Currently my full list of forums is using the same template files as the full list of sub-forums, and that doesn’t look so great.