Online Casino In Usa For Mac Las Vegas Online Casino With No Download Instant Play Casino Slots No Download Best Slots Around The World No Download Slot Machines Games Flash Casinos Usa Players Online Casinos No Downloads Best Top Usa Casinos Online New Casino Sign Up Bonuses Casino Sign Up Bonus Us Players Us Blackjack Bonus Code American Online Slots Promotion Codes For Online Casinos Brand New Online Casino Video Bonus Slots European Roulette Online In The Us Play Real Money Slots List Top 20 Casinos For Us Players Top American Casinos Casinos Accepting Us Deposits New Bonus Slots Online Best Blackjack Bonus All No Download Slots Internet Casino Gambling Online Online Gambling Blackjack Mac Ewallet Express Instant Play Online Casino Online 5 Reel Bonus Slots Best Casino Downloads Casino Bonus 2010 Best Payout Slot Machines Us No Download Casino Online Casino Accepting Us Credit Card Deposits Best Flash Online Casinos Casino Instant Play Top Online Craps Casinos Slots Bonus Usa Accepted Deposit Amex Casino Online For Mac With Instant Play 2010 Best Online Casinos Video Slots No Download Blackjack United States Best Online Craps Casino Usa Online Casino Bonuses Online Flash Usa Casinos Casino Download New Bonus Codes For Casinos Gambling Site In Us 3 Reel Slots No Download Casinos That Play For Real Money Mac Casinos Casino Online Us Player Accepted Casinos For Usa Players Internet Casino Card Games Casino Usa Legal America Casino Bonus Online Casinos With Slots Tournaments For Usa Players Bonus Slot Machines Roulette Casino Games Web Casinos Accept Credit Card Sign Up Bonus Online Casino Best Deposit Casino List Casino Online Games For Mac Best Us Online Casino With Slots Slot Machines With Bonus Games All Online Casinos List Top Casino Bonus For Us Players Best 2010 Casino Games New Casinos Online For Usa Players Internet Casino Rating Igt Online Slots Us Play 5 Reel Slots Online Casinos That Accept Us Mastercard Real Money Online Casinos For Americans Top 10 Rated Casino Games Slots Tournaments Online Top American Online Casinos Play Casino With American Express Any Online Casinos Take Amex Slots Online Blackjack Real Money Us Accepted New Rtg Casino Bonus Instant Play Slot Machine At Casino List Of All Casinos In Us All New Slots Casino Play Usa Ewalletxpress Online Gambling Online Slots Play Now New Online Casino Usa New Online Slot Games Best Payout Casino Slots Video Slot Vegas Casino Video Slots Bonus Bonus Slots For Us Players Deposit Bonus Blackjack Casino Online For Us Player Online Slot Casinos For Us Players Usa Online Credit Card Casino Online Slots Best Odds Craps Online For Us Players Best Pay Out Casinos Usa Rtg Casinos Instadebit Real Casino Video Slots Online 400 Bonus Slots Internet Casino Rankings Online Roulette For Us Players Best Casino Promotion Forum Play Real Casino Video Slots Safe Online Usa Casinos Casinos In The United States Casinos Directory Virtual Casino Blackjack Casino Video Slots On Line Online Craps Blackjack Rtg Casino Coupons 2010 Casino New Bonus Codes Online Casinos Excepting All Us Players Flash Online Casinos Play Online Casino For Mac Casino Bonus Promotion Code Play European Roulette Us Accepted Flash Casinos Online Casino Mac Mac Gambling On Line Newest Slots 2010 Online Us Casinos With Moneybookers Online Gambling For Us Players Online Slots Best Bonuses Casino Sites For American Players Internet Casino Sign Up Bonuses Instant Play Casinos Usa Friendly Best Online Casino Allow Us Amex And Online Casino Casino Games Craps All Casino Bonuses And Codes Us Players Play Casino At Home Real Money Play Craps Online Now Flash Play Casino Usa Welcome Usa Roulette Casino Bonuses The Internet Casino Portal Real Money Slots Bonus Us Casinos With Fast Payouts American Online Casino Games New Online Casino Us Player Best Blackjack In Vegas Casino Usa List Best Slots On The Net Online Casinos For Usa Players Flash Sign Up Bonus Us Players Online Slot For Real Money American Online Usa Casino Slot Payout Online American Casino Games Play Slots Online No Download Required Bonus Slots No Download Play Casino Games For Money In Usa Play Us Casinos Credit Cards Gambling Flash Casino Sites Play Real Money On Wheel Of Fortune Slots Online Gambling Us Ok Internet Deposit Casinos 3 Reel Slots Usa Players Casino Games For Mac In Us Online Usa Slots Easy Online Casino Play Casinos Us Players Bonus Slots Machine Play Slots Online With Bonus Casino Slots Best Odds Play Online Slots For Money Casino Bonus For Roulette All Casinos Online List Real Money Online Craps Best Mac Online Casino On Line Casino Slots Usa Mastercard Online Casinos Casinos Play For Real Cash On Line Casinos Accepting American Express Online Slots That Take Mastercard Best Casino Start Bonus Best Gambling Casinos Us Players Top Casino In America 5 Reel Bonus Slots Best Internet Casino Sites Video Slot Tournaments Best Slots Casinos Online Play Online Slots United States Flash Casino Us Amex Ewallet Xpress Casino Sites Real Video Slots Online Rtg Casino Untied States Play Gamble Online For United States Players Best Online Slots No Downloads Rtg Slots Bonus Online Casino That Accept Us Players Online Casinos United States Can Play American No Download Casino New Casino Slot Machines Casino Games Online That Accept Mastercard Brand New Casinos Online Best Online Flash Casino Bonuses Casino Online Us Blackjack Casino Online Best Mastercard Play Online Casino Who Accept Master Card No Download Casinos For Us Best Promotions For Online Gaming For All Us Players 2010 New Online Casinos Best Moneybookers Casino Online Roulette No Download Bonus Casino For Mac Instant Play Online Casino Games Lastest Rtg Casino Coupon Codes Roulette Slot Machine Online Slot Tournaments Usa Players 3 Reel Slot Machine Downloads Rtg Casinos For Usa Players 99 Slot Machine Signup Bonus Best Bonus Casinos For Us Players Blackjack Gamble Real Money Internet Casino Video Poker Real Vegas Flash Casino Play Slots No Download Real Money Usa Casino Sites Online Slots No Download Brand New Casino Us Players Casino Game No Downloads 2010 Newest Online Casinos Casino Usa Real Money 2010 New Casinos Online Moneybookers At Casinos Online Casinos That Accept Mastercard Deposits Casinos Rtg New Codes Online Casinos That Accept Mastercard American Online Flash Casinos Usa Casinos That Take Mastercard Us Real Money Casinos Casino Usa Slots Gamble Online Real Money Play Casino For Real Money Codes For Rtg Casinos Internet Casino Keno Best Rated Casinos Online Casino Us Amex Best Internet Casino Sign Up Bonus Online Slots Casino Slot Machine List Online Usa Sign Up Bonus Casino No Download Mac Slots Games Best Usa Casino High Roller Casino Gamblers Play Online Craps For Money Usa Best Online Casino Casino Play Real Money Gamble Online Websites Casino Welcome Bonus Money Newest Casino Bonus Codes Online Slots Usa No Download Amex Casino Accept American Express At Online Casinos Rtg Casinos Using Ewallet Express Online Slots Usa Players Best Slots Deposit Bonus Online Blackjack Real Money Us Accepted Blackjack Gambling For Mac Gamble Online Australia Best Online Casinos Usa American Casino Slot Machine Top Pay Online Casino United States Slots Usa Accepted Craps Online Video Games Internet Casinos Directory Vegas Casino Payouts Instant Online Blackjack Online Casino Mac Roulette Casinos In America On Line Gamble Online For Cash No Download Casinos Online Usa Brand New Online Casinos 2010 Internet Casino Guide List Of All Us Legal Online Casinos Online Casino That Accept Us Players With Bonus No Download Slot Machines Online Casino Blackjack Mac Bingo Sign Up Bonus Online Slot Machine Real Money American Express Casinos Casino Online For All Us Players New Casino Bonus Code Top 10 Online Casino Internet Casino Site Reviews Casino Listing Play Real Money Slots With Bonus Casino Games For Mac Best Online Casino Payouts Mac Online Casino Roulette Online Slot Play Money Best Online Us Casino Legal Online Usa Casinos Top 50 Online Casino Casino Slots Bonus Usa Brand New Casino Slots Game No Download Blackjack Real Money Playing Slot Machines At Casino Latest Rtg Casino Codes Play Slots Online Usa No Download Slots With Bonus Echeck Casinos Play No Download Instant Casinos Craps Online Mac Best Internet Casino Sites Credit Cards Accepted At Casino Slots With Bonus Download Instant Signup Bonus Casino Roulette Sign Up Bonus Play Online Casino In The United States Roulette Deposit Bonus Casinos Online Using Amex Top Casino 2010 Top 10 Casinos Best Slot Machine Bonus Rtg Casinos Deposit Bonus Instant Play Casino For Us Players Complete List Of Rtg Casinos Mac Casino Online Top Paying Casino Games Instant Play Rtg Casino Casino Bonuses Blackjack Play For Real Money Casinos New Slots Games For Mac Casino Bonus Game Slots Online Gambling Websites For Usa Real Casino Download Rtg Casino Bonus List Slot Casino For Us Players Online Casino Mac Us Player New Internet Casinos Instant Casino Bonuses All Flash Casinos No Download Ewallet Express Slot Tournaments Best Online Slots Usa No Download Casinos For Us Players Online Casino That Allows Us Players Casino New Bonus United States Online Casinos With No Download Welcome Bonus Casino Rtg Casinos That Accept Visa Top Usa Casino Bonus Online Casino Us Players Slots Online Slots Us Players 2010 Online Casino Codes Onlin Casinos For Real Money Best Odds Online Casinos Casino Online Real Money Casinos For Us Players Instant Casino Bonus Codes List Of Slot Machine Names Online Casino That Accepts Ewalletxpress Play Casino Style Video Slots Online Real Money Online Casino No Downloads Bonus Slots Play Online Casinos In Usa For Real Money Gamble For Money In Online Casinos Las Vegas Casino Usa Online Internet Casino Sites Flash Casino For Usa United States Casino Payouts All Us Players Online Casinos Bonus Codes Casino Video Poker

How I Built the Theme Playground bbPress Theme

bbPress logo

WordPress logo

I’ll be the first to admit that not every website needs a forum, not by a long shot. Not many blog communities are very conducive to a full blown discussion board. Most of the time a comment section works just fine.

But if you decide a forum is appropriate, as I have decided, and you happen to run your website on WordPress, as I do, then you should absolutely consider using bbPress to run your forum. I did that last one also.

For those who don’t know, bbPress is open source forum software built by Automattic, the same people responsible for the continued development of WordPress. The bbPress template system is comparable to the WordPress system, but there are slight differences here and there that I’ll talk about as I walk you through how I built the Theme Playground bbPress theme.

Forum screenshot

The bbPress template structure

With WordPress all theme files are located in /wp-content/themes/. By default bbPress themes are found in /bb-templates/.

The one thing I know I wanted to accomplish by adding a forum to Theme Playground was complete integration into Theme Playground’s current design. So for the forum theme the header, footer, sidebar, styles — they’re all coming along for the ride.

I started with Kakumei, the default theme that comes packaged along with a new download of bbPress. I wouldn’t exactly call it a Sandbox theme by any means, but it’s as good a starting point as anything.

In Kakumei, and in any decent bbPress theme, your theme folder is going to look something like this:

  • screenshot.png
  • /images
  • style.css
  • edit-form.php
  • edit-post.php
  • favorites.php
  • footer.php
  • forum.php
  • front-page.php
  • header.php
  • logged-in.php
  • login-form.php
  • login.php
  • password-reset.php
  • post-form.php
  • post.php
  • profile-base.php
  • profile-edit.php
  • profile.php
  • register-success.php
  • register.php
  • rss2.php
  • search-form.php
  • search.php
  • stats.php
  • style-rtl.css
  • tag-form.php
  • tag-single.php
  • tags.php
  • topic-tags.php
  • topic.php
  • view.php

Most of these files should either look very familiar to you (since they follow the basic WordPress theme format) and the rest shouldn’t seem too foreign, as their names basically describe what they do. The one thing you might notice missing, as you should, is that there is no sidebar.php file listed. This is because bbPress doesn’t support dynamic sidebar widgets (yet). So instead I’ll drop my site’s sidebar HTML output into the bbPress footer.php file.

Template tags

So first I copied the HTML from the header.php of the theme I’m using for Theme Playground (WordPress). Remember, I want everything to fit seamlessly into my current site, like it’s just another section of the site rather than a whole different one. But there are differences between template tags. When going from WordPress to bbPress there are changes that need to be made.

To give you an idea, here’s a quick table, a sort of conversion table, of template tags across bbPress and WordPress.

What it does WordPress template tag bbPress template tag
Site name bloginfo('name'); bb_title();
Site description bloginfo('description'); bb_option('description');
Site URL bloginfo(‘url’); bb_option(‘uri’);
Page title the_title(); view_name();

So you can already see how certain things will translate without a problem. Any titles, home links, and titles will all convert over. But there are certain aspects what won’t be able to smoothly carry over. Pages, for example, are natively supported in bbPress, though there are Plugins available. But what I wanted to link to where pages already existing on my WordPress install. So, in this case, I chose to link to the pages directly in my bbPress theme.

I followed suit with the footer file, copying over the HTML, this time including my WordPress theme’s sidebar.php.

Regarding the stylesheet

Instead of copying over style.css from WordPress to bbPress, I linked directly to my main theme’s stylesheet. By doing this instead of copying over the file I won’t have to manage two CSS files, one will work for both. I can also leave the images folder in place, since all of the same files will be used.

The most prominent HTML element in a bbPress forum is the <table>. For those of us creating websites the right way (which I’m happy to say should be most of the readers here) this may bring about a slight twitch. After all, <table>s hardly ever have their place in our website content.

Of course, they do have a place. Though I’m not sure yet that I want to call a forum listing (see, key word there) tabular data, I can at least see that there is an argument to be made.

All of that to say: you’re going to need decent table styles. In an effort to give you a head start, here are the table styles that work for me:

table {
	margin-bottom: 40px;
	margin-top: 20px;
}
table tr {
}
table tr:hover {
	background: #efefef;
}
body.page table tr:hover {
	background: #fff;
}
table td {
	border-bottom: 1px solid #eee;
	font-size: 0.8em;
	line-height: 1.8em;
	padding: 5px 0 5px 5px;
	width: 270px;
	vertical-align: middle;
}
table td.num {
	border-left: 1px solid #eee;
	padding-left: 0;
	text-align: center;
	width: auto;
}
table th {
	background: #eee;
	font-weight: bold;
	border-bottom: 2px solid #ccc;
	border-top: 1px solid #ccc;
	line-height: 1.8em;
	padding-left: 5px;
	vertical-align: middle;
	width: auto;
}
table th.num {
	padding: 0 22px;
	text-align: center;
}

The default theme also contains some nasty techniques like placing <form> elements inside of <table>s, which is frustrating. I’ve yet to go through and change out all of that HTML, rest assured I will post a corrected theme once it’s ready. Until then, just keep in mind that you may need to add in some styles to undo the table effects on those forms, for the time being at least.

Areas of interest

One thing I really enjoyed about working up the bbPress theme was finding alternative uses for what would end up being empty in the bbPress theme. The two I’m speaking of are the top and bottom areas of the content area of the design. Currently the top area houses only top level categories while the bottom holds any page navigation, if necessary.

Categories aren’t really a part of bbPress in any way. There are tags, but the nature of tags means there would be far too many to list in that small of an area. Since the reason for including top level categories on the blog is because they are relevant and useful, I added some similarly useful links on the forum side:

Top area on the blog

Top area on the forum

Then for the bottom area, in a similar manner I’m displaying the page navigation on the blog, but the recently active members on the forum. Displaying member information is something that you’ll need a Plugin for. Speaking of which, let’s talk about bbPress Plugins.

bbPress/WordPress integration

It’s not enough, really, to only have a forum that lookslike it’s a part of this blog. I really need the two to work together.

The bbPress install directions give you straightforward instructions for WordPress and bbPress sharing user tables, which is the beginning of the integration process. One extra step that you will probably want to take is to make sure that your members’ login states are maintained between the blog and the forum. If your members log in on your blog they should be logged in when they visit the forum, and vice versa.

To manage the cookies between the two, you’ll want to grab the bbPress Integration Plugin (for WordPress) by Michael Adams and Sam Bauers. In most cases this should be all you need to work with to get the login states to match.

Login and user links

There are a few Plugins that exist for WordPress that will allow you to display a login form and related links for your users. After exploring each of these (worth reviewing for a future post, I imagine) I settled on a more manual method.

You can use a built in WordPress function to determine whether or not a user is logged in. You can see my use of this on the upper-most right portion of the site. This is the HTML and PHP I’m using in my WordPress theme:

    <?php if ( !is_user_logged_in() ) { ?> <?php } ?> <?php if ( is_user_logged_in() ) { ?> <?php if ( current_user_can('edit_users') ) { ?> <?php } ?> <?php } ?>

That covers the WordPress end of things. But how do we get the same functionality for bbPress? This is how:

    <?php if ( !bb_is_user_logged_in() ) { ?> <?php } ?> <?php if ( bb_is_user_logged_in() ) { ?> <?php if ( bb_current_user_can('write_posts') ) { ?> <?php } ?> <?php } ?>

There are slight differences, but both are pretty much doing the same thing. By creating your member navigation in this way you have more control over what shows up than if you used a Plugin. You will still need to, however, set up your Register and Login pages to fit in with the site.

I’m actually probably a bad example of pulling this off. Rather than use any particular Plugin, I edited WordPress core files to seamlessly integrate those pages. Same for bbPress. So while I won’t go into them here, for the sake of not encouraging others to go down that same road which could cause problems. If there is interest I’ll set aside a separate post for that and go through the safest way to go about it.

bbPress Plugins

One of the other things to adjust to is how bbPress handles Plugins, which is only a tiny bit different than how WordPress does.

You can find bbPress Plugins at bbpress.org/plugins. For the most part you’ll find answers to common problems, since there are definitely people using this platform. In my case, I’m also trying to rethink how exactly forums should function, so stripping down the functionality and slowly adding back to it was how I approached the Plugins.

Actually I would suggest anyone wanting to use bbPress do exactly what I did. Take some time and browse through the list of available Plugins and check out those that sound helpful. Don’t worry, there are far fewer bbPress Plugins than there are WordPress Plugins (for now), so it won’t take you that long. I actually discovered quite a few Plugins, some extra functionality, that fit perfectly with Theme Playground which I wouldn’t have even thought of wanting before.

Now, the Plugins that I’m using on the Theme Playground Forum:

  • bbSocialize by F.Thion — Allows you to add social URLs to member’s profiles. Seems pretty flexible, too.
  • Members Online by _ck_ — Will give you a list of members currently online (right this second) and online throughout the day. It’s what I’m using for the bottom-most part of the content area on the forum right now.
  • bbPress Attachments, by _ck_ — Gives members the ability to attach files to their forum posts.
  • Related Topics by _ck_ — Works the way you would expect, the way the WordPress Plugin with the same name works.
  • bbPress Signatures by _ck_ — Members can add signatures to their posts.
  • Comment Quicktags by Stefano Aglietti — Gives everyone a toolbar of quicktags (basic HTML elements) for posting.
  • Hidden Forum by _ck_ — Mark certain forums as hidden, restricted to only certain members.
  • User Directory by Paul Hawke — Gives a list of members on the forum. Very flexible, uses a template file.
  • bbVideo by Naden Badalgogtapeh — I’m still on the fence about whether this one will stick around or not. It turns any link to a video into the actual embedded video.
  • PollDaddy for bbPress by Sam Bauers — Allows the posting of PollDaddy polls using a quicktag.
  • Admin add users by Thomas Klaiber — Allows admin users to add new members on their own. Note that if you have bbPress and WordPress sharing the users table, this may be superfluous.
  • Display name by Michael D Adams — Probably my favorite Plugin I’ve found so far: displays member names as their display names (regular First Last format) rather than their technical username (firstlast).

Final thoughts

I am aware that there is a method of bbPress/WordPress integration that involves loading WordPress functions on every page load of bbPress, and vice versa. I didn’t go down this road for two reasons: it’s not necessary for what I need, and Those Much Smarter Than ITM strongly recommend against it. Do a search for “bbPress” on the WordPress Plugin repository, though. You’ll find a few that will help you display forum content on the blog side of things.

And I’m not going to offer up a version of the Theme Playground Forum theme for you to download, since the customizations are a bit too heavy to be very useful for you. But I will tell you I’m working on a bbPress theme that should make it a bit easier to build themes from. More on that later, be sure to subscribe so you don’t miss out.

The blog:

Blog screenshot

The forum:

Forum screenshot

I’m sure you’re thinking exactly what I’m thinking now: it’s going to take a hell of a lot longer to redesign the site next time.

Technical questions?

This will be the first of probably many times I say this: any comments on this post (a nice “Thanks!” is always appreciated) or references to other related materials are welcome in the comment section below. Any technical questions, though, or in general questions for me that you have about bbPress in general, should be directed to the new forum. That’s what it’s there for — actual back and forth conversation. Thanks!

→ On the forum: All about this bbPress theme


Did you enjoy this post? Then it might be worth your time to subscribe via RSS using your Feedreader or, if you prefer, via email.

About the Author: Ryan Imel

My name is Ryan Imel, and I’m a full time freelance web developer. I work a lot with WordPress, but am comfortable with other systems too.

10 comments so far

  1. Jarret said:

    Wow, really great job on the overall forum integration and writing the post as well!

    While I haven’t messed around much with bbPress (yet) this post will definitely help me once I do get around to working with it. Thanks for the list of plugins :)

  2. Cheng Soon said:

    AWESOME (as I’ve been waiting for this), Ryan. Thank you for sharing.

  3. Thanks for sharing your experience with bbPress. I keep meaning to write something this in depth on what I’ve done but can never find the time.

    For your sidebar, you can actually use a sidebar.php file. bbPress has a template function for this. Here’s how you’d do it:

    require_once( bb_get_template( 'sidebar.php' ) );

    And, I would definitely argue that a forum listing is tabular data. I think we’ve all got to this point where we think all tables are bad and want to find ways to not use them even when it’s a perfectly logical time to put them to use.

  4. Thanks for the overview Ryan. I played around with bbPress a few months ago, though admittedly never got very far with it. I’ve been meaning to get back to it so it’s nice to have some direction when I do.

  5. Ed King said:

    Really cool. Thanks for sharing with us.

  6. Xev Xarzu said:

    Who are “Those Much Smarter Than I”. The way you mention them makes them seem like real people with a real website. So far, I have not found them. Because of the nature of my site, I want to have the forum and the blog linked up. Is it going to be hell?

  7. roshni said:

    Dear Buddies;
    I’m using bbpress revolution theme, it’s working gud but when i go to the add new topic, then it’s coding looks disturb. hot tags and search bar leave their places and they merge in the side bar with adsense. please see it. and tell me what can i do.

    here are it’s screen shots

    1. http://img519.imageshack.us/img519/559/addnewtopic.jpg
    2. http://img141.imageshack.us/img141/1161/frontend.jpg

    love you all

  8. Nico said:

    I’m trying to build a custom theme for my forum (http://bookclub.plutonica.net) that matches the design of my blog (http://www.plutonica.net). When I place the theme in /bb-templates/ it sort of works, but I understand I’m not supposed to do this for reasons that seem ill-defined. However, when I place the theme (bookclub-10) in /my-templates/ it refuses to locate the CSS file, though I’ve tried to lead it to its exact location.

    Any suggestions? Thanks for your time!

  9. Banago said:

    Wonderful post – thanks for sharing.

Add to this discussion

Required: We need to know who you are.

Required: Your email will not be published. This will also give your comment a gravatar. (What is a gravatar?)

Optional: This will make your name clickable.

Required: Kind of the point of this whole form, don’t you think?

Trackbacks/Pingbacks

  1. [...] Theme Playground | How I Built the Theme Playground bbPress Theme (tags: bbpress wordpress forum theme howto tutorial) [...]