bbPress 2.0 – Theme Compatibility
-
A few questions have cropped up already, so lets funnel the discussion here.
bbPress 2.0 introduces a radical new approach at integrating robust new functionality into existing WordPress themes. If you’re an average user looking for a turn-key forum solution, this works out pretty awesomely – If you’re a talented developer trying to beat your own drum, it’s all probably a little bit confusing.
Theme Compatibility
bbPress comes with a child theme of TwentyTen, titled (you guessed it) bbPress – TwentyTen. This theme includes all of the custom bits that bbPress needs to function, broken up into template parts to allow them to be used in several places, like template files, shortcodes, and widgets.
- MOST COMMON – If you’re using any other conventional WordPress theme (TwentyEleven, BP-Default) and find the default template layout of bbPress acceptable, you don’t need to do anything at all – it should just work.
- DO NOT put any custom themes in “/bbpress/bbp-themes/” as they will get wiped out when you update bbPress.
- CUSTOM – If you want to build your own theme or make changes to the existing template files, you’ll need to do the following:
Copy Files
- If this is not a custom theme under your control (meaning you are not the author) you’ll want to copy the contents of the “/bbpress/bbp-themes/bbp-twentyten” folder into your “wp-content/themes/%YOURTHEMENAME%” folder, where %YOURTHEMENAME% is the name of your custom Child Theme of whatever your current theme is. This is so theme updates don’t wipe out all your hard work later.
- If you are the author of this theme, then you can copy all the files *out of* the “/bbpress/bbp-themes/bbp-twentyten” folder into the folder of your theme, and make your own edits from there. The files to copy include the single-*, archive-*, page-*, and anything in the subfolders.
- In neither case should a new folder with the name “bbp-twentyten” exist. You are not copying the FOLDER, you are copying what’s IN the folder.
Add Theme Support
Now that you’ve got the files copied over, you’ll need to tell bbPress that you are in control of the theme situation. You do this by adding this to your functions.php file:
add_theme_support( 'bbpress' );
By doing this, you’re telling bbPress that your theme has its own template files to handle all of the new functionality that bbPress adds. This method gives you a single on/off switch to either use the standard theme compatibility, or use your own.
In the future, specialized template compatibility themes can be created either as plugins or child-themes to work like “add on packages” to existing themes, without requiring elaborate edits to existing themes, moving files around, etc…
Shortcodes (as of May 23, 2011)
Whether you rely on theme compatibility, or decide to go the custom route, we’ve included a few standard shortcodes to let you output specific forum content on any post or page in your forums. This is accomplished within an output buffer, so they won’t interfere with any of your existing page or post content. Note that if your theme specifically removes the shortcode functionality, these will not work, and will instead the actual text of the shortcode will appear on your site.
- [bbp-forum-index] – Show the root forums
- [bbp-single-forum id="A forum ID"] – Show a specific forum
- [bbp-topic-index] – Show all topics
- [bbp-single-topic id="A topic ID"] – Show a specific topic
- [bbp-topic-tags] – Show all topic tags
- [bbp-topic-tag] – Show topics of a specific tag
- [bbp-topic-form] – Show the new topic form
- [bbp-reply-form] – Show the new reply form (not commonly used)
- [bbp-single-view id="A view slug"] – Show the topics of a registered view
In the future, we’ll be adding more shortcodes as the needs arise.
That’s it for the first round of explanations. I’ll edit this post as more questions and answers come through.
-
@Kalman – If you’re already using a child theme, you’ll want to copy everything out of bbp-twentyten (except functions.php and style.css) into your child theme. You will want to merge the contents of your functions.php file with the one from bbp-twentyten. Because child themes are inherently different, you’re forced to make these play nicely on your own.
Hi there,
first of all: thank you for this great Forum-Plugin!
I’ve got the standard installation by now and the shortcode [bbp-single-forum id="testforum1"] isn’t working for me.
Has anyone any idea what’s wrong?
[bbp-forum-index] on the same page works perfectly .. but i only want a single forum.
Thank you!
Those of you with custom themes where you’ve moved files around may need to move files one last time, as some changes to the theme compatibility routine and template structure in Beta 3 (based largely on user feedback) have shuffled things around a bit.
If this is you, you’ll want to back up your custom template files (so you don’t lose your edits), copy the contents of bbp-twentyten into your theme (like you did before), then go through the changes and make sure everything is working the way you want it to.
This will be the final theme compatibility change in 2.0.
Have been facing a number of issues with themes :
1. Twenty ten and the child theme that comes packaged with the plugin
The fourm listing page does not show up . ( The page with all the main forums .
2, Under theme compatibility I face similar issues
Though with Erudite theme the links for the main forum did show up on the main forums page.
3. Lets say I want the forum to show up on a sub-domain?
4. Wouldn’t it be just easier to have the option to have a separate theme just for forums ?
Example just go to the dashboard and enable a theme specifically for
the bbpress forums as one does for multi site ?
5. Are you planning on stopping development for the standalone bbpress installation ?
It might be possible to hook into the template loader, see what the request is, and force it to look into a different folder, but there’s no possible way to do it at all with page templates; it’s actually purposely disallowed to prevent the theme from having to scan every file inside every subfolder to find them.
Minor technicality: This is actually technically possible with page templates. It’s just very awkward and involves a lot of side-stepping to achieve it. I looked into this for a project a while ago and came up with a really awkward way of doing it, and Otto came up with a much nicer solution, but both solutions were still pretty awful. Off the top of my head I can’t remember how either worked, but it was indeed possible. There’s a forum thread on WP Tavern about it somewhere – could be difficult to find though.
One small fix I did right off the bat:
I moved the css/ and js/ directories into the included bbpress/ one and changed several references to their location in the bbp-twentyten templates. This allows the top-level theme directory be just a bit cleaner, as I know my theme (and many others) already have a css/ or js/ directory. Moving those into the bbpress/ sub-dir improves “clutter” and compartmentalization, IMNSHO.
Does anyone see any problems with this approach that I’m not seeing?
@zamoose – Beta 3b normalizes some function names from Beta 2, based on feedback from confused users trying to find the right functions to use. If you previously moved the bbPress bbp-twentyten templates into your custom theme, you’ll need to do that again with Beta 3/3b. No other structural changes are going in before 2.0.
Let me start by saying I am not an advanced user. However, I would be interested in trouble shooting a theme compatability issues.
The 2010 theme works great for the bbPress plugin.
However, I have a theme which I would like to use which bbPress does not work for.
I have set up a score of forums and only the parent forum shows after resaving the permalinks. The test topics do show, but people would not have the ability to add anything like a new topic or reply.
The theme has many options and I would prefer to use it over a standard WP theme. However, I am not sure why it is not working for the bbPress Plugin.
Will bbPress have something to help convert themes or do you have any idea what is going on?
If it is too much recoding on my part I might just use the 2011 theme when it rolls out. Or think of plan b.
My site as it is now is http://peopleandlanguages.com/
Thanks and sorry in advance if this question is not the type of question you look at, rather you adress more macro issues.
Hi John, excited about getting bbpress integrated on my site, thanks for all the work you’ve done on it. However I’ve tried to get it running and I think I’m having a similar problem to what mbiernat describes above with only the parent forum showing.
I heard there is a new version coming out and maybe this is addressed in that, but just wanted to let you know and see if there was a solution. The site is http://amishamerica.com/
Thanks and all best!
@mbiernat – Since your question is about theme help with your site specifically, would you mind creating a dedicated topic for assistance? bbPress itself appears to be running fine there.
@ejw – I am unable to find bbPress on your site anywhere, which might be a bigger problem. I’d ask that you do the same and open a dedicated support topic for your issue.
I’m having an issue and not understanding how to fix it is driving me bonkers. I’ve followed the steps above but let me explain how I did it.
Once the plugin was installed I copied the bbp-twentyten folder from the plugin directory;
C:xampphtdocsempt-wpwp-contentpluginsbbpressbbp-themesbbp-twentyten
and put it into my main themes directory and renamed it to bbp-empt.
C:xampphtdocsempt-wpwp-contentthemescostbbp-empt
I opened the bbp-empt style.css and changed the Template name to;
Template: cost
and added an import for the css.
I have every file in the “bbp-empt” folder than was in the original “bbp-twentyten” folder plus files like archive.php, page.php and single.php from my “cost” folder.
I’m confused as to how I get the forums to use the template files in “bbp-empt” and not the files in the “cost” main directory. Which is what is happening right now.
Small update
After some experimenting I changed the bbp-empt folder style.css in the plugins folder to say cost in the template name and changed other details. Noticed the change in the Appearance menu so I clicked to activate the template and now I’m using a child theme of my main theme with the bbpress using the bbp-empt files.
So now I’m honestly just confused, if this works whats the point of moving it to your main themes directory?
@nate – Seems you’re only following some of the steps outlined above. To start you’ll want to research WordPress child themes and how to make one. If you decide to go that route, then your new theme doesn’t go inside the old one, it goes in the /themes/bbp-empt/ folder that you create. It kinda sounds like you figured that out, but it’s hard to tell from your comment if it’s working for you.
Thanks for responding. I thought I followed every step. Let me clarify since I messed up my earlier clarification.
I initially copied the default theme put it in the same plugin directory and renamed it to bbp-empt. I included the function code in my main theme “Cost” directory function.php file. After some fooling around I realized nothing was working so I came here and followed every step in this thread instead of half-assin it like it did before.
I would prefer not to use a child theme since I’m the Author of the “Cost” named theme I’m using. I guess I don’t quite understand how I get bbpress to use bbp-empt when it’s sitting in my Cost directory. Is there a instruction manual that describes that process?
Or is it a simple function name change or is there a place in the WP admin area I missed which allows you to chose the which template bbpress uses?
@Carsten.M – You need to use the numeric ID of the forum. I realize this isn’t the easiest for everyone, but it’s the easiest and fastest way to develop it for now. In the future we’ll open this up to other things and build a UI for it all.
@Nate – I updated the instructions at the top with more details. Give them another go. All you need to do is copy the contents of bbp-twentyten into your theme, and merge the style.css and functions.php files together so they fit what you need – this I can’t help with because it involves code only you probably know.
i’ve copied alla files from bbp-twentyten to my WP theme directory but i cant’see nothing http://www.flussocreativo.com/forums
which mistakes i’ve done?
is there a shortcode for user registration and login?
I didn’t test these myself, but in the bbp-core-shortcodes.php file (of RC1 from the trac) it states the following shortcodes:
[bbp-login][
[bbp-register]
[bbp-lost-pass]
So those might work.
Does [bbp-forum-index] take a parameter or is there a variation of this shortcode that displays all forums and not just the root ones?
Also, is there an easy way from within a theme (say in functions.php or via style.css) to change the default size of gravatars in the topic reply dialog? I’m assuming it would require a function as bbPress is setting it via a function, from what I was able to glean peeking at the bbPress code. Thanks.
I have all files in the “bbp appropriate” folder that was in the original “BBP-TwentyTen” folder of files as archive.php, page.php and single.php in my “cost” of the folder.
I’m confused as to how to get the forums to use template files in “bbp appropriate” and not the files in the “cost” of the directory. That is what is happening right now.
Twentyeleven using a child theme that puts a sidebar on regular pots does not display aby widgets on bbPress pages as did Twentyten.
The child theme I used is that described in “Add Sidebar Support in Posts for the Twenty Eleven Theme” at http://futurewebblog.com/add-sidebar-support-posts-twenty-eleven-theme/
Any advice on getting widgets into the side bar?
Murray
Odd bug with P2 and bbPress (in theme compatibility mode). Create a page to serve as the homepage and a page to serve as the blog page. Enable bbPress and create some forums, topics, and replies. Modify your settings to use your homepage as the static page and your blog page as the blog page. Visit the homepage and make sure the title is correct. Now add the bbPress Reply List widget to the sidebar and visit the homepage and note the title is one of the forums and not the title of your homepage post. You get the same behavior if you add the Topic List widget. Not sure what the issue is. I’ll also submit a ticket here but it could be an issue with P2.
Hi i am using lifestyle child theme from genesis framework..I followed all the steps to create bbp forum template. Everything is working fine except i get more than 10 warning messages like this when i click register or login button. http://www.ravidreams.in/offgrid
Warning: Cannot modify header information – headers already sent by (output started at /home/ravidrin/public_html/offgrid/wp-content/themes/offgrid/functions.php:311) in /home/ravidrin/public_html/offgrid/wp-login.php on line 353
also for your information i have added a login/logout script
Shall i pm you the functions.php file..if yes plz send mr your mail id
I was wondering… will there be a way for users of the forum to be able to post pictures down the road? Can they do it now? or do they need to know html posting codes SRC or the like to put a picture into the forum for others to enjoy…
My forum is a fall foliage in New England http://jeff-foliage.com/fall-foliage-forum/ and I’m getting some interest in the forum but it’s very light yet. It would be nice if they could upload directly but that might be dicey… So I assume they would have to host it somewhere like Picassa and then link back to the forum…
It would be nice though to just have the code there that they click a button to find it online or if they have the code from their site they could paste it in while it’s being hosted at their storage location…
- The topic ‘bbPress 2.0 – Theme Compatibility’ is closed to new replies.