bbPress: Welcome Notice Above the Forum Index
Shows a short welcome or rules notice above the list of forums, with a link to your community guidelines.
Opens WPIDE on
Code
if ( ! function_exists( 'is_bbpress' ) ) {
return;
}
$wpide_bbp_notice_text = 'Welcome to our community! Please be kind, search before posting, and read the guidelines.';
$wpide_bbp_notice_link = home_url( '/community-guidelines/' );
add_action( 'bbp_template_before_forums_index', function () use ( $wpide_bbp_notice_text, $wpide_bbp_notice_link ) {
printf(
'<div class="bbp-template-notice info wpide-bbp-welcome" role="note"><ul><li>%1$s %2$s</li></ul></div>',
esc_html( $wpide_bbp_notice_text ),
$wpide_bbp_notice_link ? '<a href="' . esc_url( $wpide_bbp_notice_link ) . '">Read the guidelines</a>' : ''
);
} );
Notes
Edit the text and link at the top; leave the link empty to show the text only.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.