Skip to:
Content

bbPress.org

Opened 19 months ago

Last modified 12 months ago

#3487 new defect (bug)

bbPress block theme support

Reported by: mikachan's profile mikachan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 2.6.9
Component: Appearance - Theme Compatibility Keywords: has-patch needs-testing
Cc:

Description

bbPress doesn't seem to currently support block themes. When testing with Twenty Twenty-Three and Twenty Twenty-Two, bbPress pages render a WSOD.

I believe it's related to the index.php file that's included with the theme, as it looks like it's possible to (sort of) fix some of the pages by including the following in this file:

wp_head();
block_header_area();
block_template_part( 'page-inner' );
wp_footer();
block_footer_area();

There is a related discussion in the support forums: https://bbpress.org/forums/topic/template-in-block-themes/

There is also a similar ticket for the BuddyPress plugin, which seemed to be related to the index.php file as well. I'm not sure if it helps as I can't find any similar logic in bbPress, but here's the ticket: https://buddypress.trac.wordpress.org/ticket/8474#comment:31

(Apologies if this has already been reported, I couldn't find a related issue.)

Change History (7)

#1 @Robin W
19 months ago

add_filter( 'template_include', 'bsp_twenty_twentytwo') ;

function bsp_twenty_twentytwo ( $template ) {

if ( false !== strpos($template, 'twentytwentytwo/index.php') ) {

$template = ABSPATH . WPINC . '/template-canvas.php';

}
return $template;

}

This ticket was mentioned in PR #7 on bbpress/bbPress by @mikachan.


18 months ago
#2

  • Keywords has-patch added

This PR tries out adding support for block themes.

It checks if the current theme supports block-templates, and if so, uses the template-canvas.php as the main template.

This solution is based on this comment.

To test, try enabling bbPress with the Twenty Twenty-Two or Twenty Twenty-Three themes. Without this PR, the forum pages will not render. With this PR, they should render correctly.

Trac ticket: https://bbpress.trac.wordpress.org/ticket/3487

#3 @mikachan
18 months ago

Thanks, @robin-w! I've tried this out in the plugin with the above patch.

#4 @mikachan
16 months ago

  • Keywords needs-testing added
  • Severity changed from normal to major

#5 @arafatjamil01
12 months ago

I have checked your pull request on Github and tested the code. The code worked perfectly. Please add an extra * at the beginning of the comment.

That is

/**

Instead of

/*

Just to maintain consistency with the other comments.

#6 @Robin W
12 months ago

@arafatjamil01 thanks, I'm working on a new bbpress.php template that will work properly with FSE themes.

I plan to release this within my bbp-style-pack plugin in a week or so

@mikachan commented on PR #7:


12 months ago
#7

Thanks for the review, @arafatjamil01!

I've fixed up the comment formatting so it's consistent with the other comments in the file.

Note: See TracTickets for help on using tickets.