Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress 2.0 – Theme Compatibility


  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    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.

    1. 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.
    2. DO NOT put any custom themes in “/bbpress/bbp-themes/” as they will get wiped out when you update bbPress.
    3. 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.

The topic ‘bbPress 2.0 – Theme Compatibility’ is closed to new replies.