To insert code in a forum thread or comment wrap it in code tags : <code>...</code>.
bbPress & Striking: default sidebar not appearing on bbPress-generated "pages"
  • Hi all,

    First: apologies if I am posting this in the wrong forum.
    Second: big thanks to KaptinLin & Team for such an excellent theme.

    If anyone has managed to install bbPress with sidebars appearing automatically, I would love to know what I am doing wrong.

    My issue:
    I am trying to use bbPress, but am finding that Striking is not rendering the default sidebars on bbPress' pages (Forum, Topic, Reply). The column that is supposed to hold the sidebar remains blank with no widgets shown.

    Observed behaviour:
    No sidebar is rendered on bbPress "pages"; only an empty column.
    If I define a custom sidebar and then in bbPress edit each Forum and Topic (thread) page to set that new sidebar as custom sidebar, I can get sidebars to appear on the relevant bbPress "pages". However, once a user creates a new topic (=forum thread), it inherits the default column/sidebar and a blank column is shown.

    Desired behaviour:
    I was hoping that Striking would render either the blog, page or another sidebar in the column across all bbPress-generated "pages" when the global layout is using a column/sidebar.

    Theory / my guesses:
    Since bbPress holds each forum/topic/reply as a custom post type, perhaps the theme does not detect that it should render a sidebar for pages coming from such post types, resulting in a blank column.

    Observed on: bbPress (v.2.0.2) and Striking (v.5.1.7.).

  • 4 Comments sorted by
  • Ok, for anyone else trying to troubleshoot this...

    Have a look at the file striking/framework/helpers/sidebarGenerator.php, around line #139 in the function get_sidebar(). Striking finds that the bbPress output has a post-id, but since no custom sidebar has been set, it defaults to not print a sidebar at all.

    With the addition below (yes, I know it's ugly) we force Striking to output the "blog" sidebar for all pages that ...
    a) do not have have a custom sidebar set,
    b) also have the bbPress module loaded
    c) and have not had a sidebar identified by the earlier if statements in the function.

    if(!isset($sidebar) && class_exists( 'bbPress' ) && empty($custom)) {
    $sidebar = $this->sidebar_names['blog'];

    Ok, I hope that helps someone.
  • Actually, a better conditional might be:

    if (function_exists( 'is_bbpress' ) && is_bbpress() && !isset($sidebar))
  • And on a related note, for those of you trying to embed bbPress and coming up against integration problems...

    The blog-meta-information looks all weird on bbPress-generated pages. Instead of showing the correct date and a category, Striking prints the string "wp-admin/post.php?post=0&action=edit" in the date field.

    To hide the blog meta-info like on ordinary pages I suggest you consider changing line #468 in file striking/framework/helpers/themeGenerator.php to this:

    if(get_post_type(get_the_ID())=='page' OR (function_exists( 'is_bbpress' ) && is_bbpress())){

    Striking thinks that the bbPress forum-pages are blog posts, and this new conditional tells Striking to hide the meta-data on the bbPress pages and treat them like ordinary pages.
  • this is in function blog_meta by the way.
This discussion has been closed.
All Discussions