Skip to:
Content
Pages
Categories
Search
Top
Bottom

Suggestion: Make BBP adhere to normal custom post type template hierarchy rules


  • Ben Hayes
    Member

    @ben-hayes

    BBP currently tries to add all its forum stuff to any activated WP theme by using the page.php template. I think it would make a lot of sense if it followed the standard template hierarchy for custom post types.

    Usually, if you have a custom post type – say ‘product’ – you can override the template for that kind of post by making a specific template for it (i.e. single-product.php).

    However, as far as I can see, BBP doesn’t allow this. If I create a file called ‘single-topic.php’, BBP doesn’t use this for displaying single topics. Instead I’m locked into using page.php. That’s annoying if I want my pages to have a sidebar, for example, but my forums to be full-width.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Ben Hayes
    Member

    @ben-hayes

    Ah OK, I think I see that you have implemented something like this in version 2.1 :)

    I just tried to install the latest 2.1 beta version but I got an error from WP saying “Could not install this plugin as it has an invalid header” :(


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Invalid header issues indicate you’ve installed the plugin incorrectly, or have an incomplete download.

    It’s possible to use the core templates, but it won’t really work the way you want it to. Why? Because when you view a single forum, you also want to view that forum’s topics. When you view a single topic, you also want to view that topic’s replies. A single flat loop isn’t enough to handle this behavior, no matter what you do.

    You can still create those templates, and they will work as you’d expect, but you’ll still need to redo some heavy lifting. Probably easier to follow the bbPress conventions for now until the whole flow makes sense.


    Martin
    Participant

    @rastarr

    Do you know whether it’ll be possible to inject other code into Topics and/or Replies which other Custom Post Types allow but not yet bbPress?

    This is like Advertising or Social Media icons.

    As an example, I have the WP Socializer plugin installed for Social Sharing. When questioned about it working, the author replied with:

    “Please note that WP Socializer works in all pages or places where there the <?php the_content(); ?> function is called in the theme.”

    This seems to be the case for any other Social plugin so I’m guessing bbPress post types do not have this included.

    Further, I’m using Simple Ads Manager for injecting advertising space as well as other stuff. Works fine by picking a Custom Post Type and bbPress Topics and Replies show up, except nothing is displayed so I presume these aren’t following Custom Post Type convention, in some way either.

    Any ideas on these things?


    Ben Hayes
    Member

    @ben-hayes

    Invalid header issues indicate you’ve installed the plugin incorrectly, or have an incomplete download.

    Hmm, OK. I downloaded the zip file from the bottom of https://bbpress.trac.wordpress.org/browser/branches/plugin and used that for the plugin, which gave me the error. Maybe Trac is not working how it should, or maybe I’ve not understood something. I’m more of a designer than a coder :) I will see if I can get my head around using Subversion to get the code instead.

    It’s possible to use the core templates, but it won’t really work the way you want it to. Why? Because when you view a single forum, you also want to view that forum’s topics. When you view a single topic, you also want to view that topic’s replies. A single flat loop isn’t enough to handle this behavior, no matter what you do.

    Right, OK. That makes sense. I hadn’t thought of that.

    I still think the whole setup is potentially quite confusing though – mainly having 2 theme locations I think is what throws me. Actually I noticed that in plugins/bbpress/bbp-themes/ it says in index.php “Do not put custom themes here or they will be overwritten”. So I know we’re not supposed to edit the theme in there. But it is still quite confusing that I can activate that theme from within the WP dashboard. This is quite unintuitive, in my view. Because we are encouraged to activate a theme that we are told we should not edit.

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