this is theme related – and beyond my free help to fix, but try and work through this resource, in particular item 8
Step by step guide to setting up a bbPress forum – Part 1
Is there a simple way to make the forum index page full width? I’ve searched the support forum and copied various CSS codes but nothing worked so far..
I don’t know of anything that does this – it could be coded, but that would be bespoke work and beyond free help
Hi guys,
May I know why is language code missing bbPress search page URL? I have a multi language website using Polylang and everything works except for the bbPress function. It only returns the English data instead of the Chinese data.
Anyone know the solution to fix this?
Thank
Cristiano
By adding 'author' => bp_displayed_user_id(), to this code, my purpose can be achieved.
https://www.daggerhart.com/bbpress-recent-replies-shortcode/
But I would like to output with the same structure as BuddyPress activity.
you should check out the theme soam code than try to install the plugin it will work
actually i can conform that, once the user logged in from the web the first time, the participant role was assigned. Still not surw why bbp_set_user_role( $user_id, 'bbp_participant' ); didnt work out, maybe the timing issue as you mentioned. Thanks a lot for taking the time to test out the code and helping me out.
sorry missed that part
if the code above works then
bbp_reply_author_link( array( ‘sep’ => ‘<br />’, ‘show_role’ => false ) );
$reply_author_id = get_post_field( ‘post_author’, bbp_get_reply_id() );
$user = new WP_User( $reply_author_id );
if ( !empty( $user->roles ) && is_array( $user->roles ) )
{
foreach ( $user->roles as $role )
{
if ($role=='student') $output = 'client' ;
if ($role=='elephant') $output = 'tiger' ;
echo “<div class=’role_custom_bhush’>”.ucfirst($output).”</div>”;
break;
}
}
just alter and add as many of these lines as you need
if ($role=='elephant') $output = 'tiger' ;
I’ve just done some testing
this code :
function test_set_user () {
$user_id = 1223 ;
bbp_set_user_role( $user_id, 'bbp_participant' );
}
add_action ('init' , 'test_set_user' ) ;
changes user 1223 on site load, so the code is fine.
I think it is a timing issue – ie when you are doing this. It may well be that even if this fires, a ‘create user’ firing after will overwrite this – eg this may set for pending, but then be overwritten by the final user creation.
Of course if it is always going to be participant, then bbpress allocates the user to the default role (as set in settings>forums>default role) if no bbpress role is set on first login, so you could just set up the user, and bbpress will take care of giving them a role when they first log in!
@MarcGuay Please guide in which php file, we should put the code ?
I’d suggest that the issue is that the bp_core_signup_user is not returning a valid $user_id
you could prove that by writing a console output to see what is being supplied, eg
// create the user from the bp_core method, to make sure it passes the activation mode first
$user_id = bp_core_signup_user(
$post->username,
$post->password,
$post->email,
[]
);
echo "<script>console.log('" . $user_id . "');</script>" ;
bbp_set_user_role( $user_id, "bbp_participant" );
and then looking in the console in your browser tools
maybe better to ask the question in ten buddypress support as to why the correct user_id is not being returned
Hello,
I have a wordpress installation with both bbpress and BuddyPress installed. I’m trying to create a user from code and automatically setting the forum role to participant. I tried using the bp_core_signup_user but it has not effect. This is the part of the code where im creating the user:
// create the user from the bp_core method, to make sure it passes the activation mode first
$user_id = bp_core_signup_user(
$post->username,
$post->password,
$post->email,
[]
);
bbp_set_user_role( $user_id, "bbp_participant" );
Attached is the user profile after creation from code:

That code was very helpful, @codingmachine — one question, though. Is there any way to change the name of the roles that are output to the forum? I don’t want to change the name of the role in WordPress, I just want to change the output.
So, for example, if the user role is “Student”, I want it to output “Client”. Is this possible by editing the code you shared?
Small change to the exclusion list. Excluding the backbone.min.js and js/underscore.min.js broke the forum page.
Add the following instead:
js/tinymce, js/comment-reply.min.js
Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.
I was having the same issue. In my case, my cache plugin was breaking both the tinymce visual editor and the quick tags in the text editor.
To fix both, I excluded the following JS scripts in my cache plugins:
js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js
If you use Autooptimize then add the above piece of code here
Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:
Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.
I was having the same issue. In my case, my cache plugin Autooptimize was breaking both the tinymce visual editor and the quick tags in the text editor.
To fix both, I excluded the following JS scripts in my cache plugins:
js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js
If you use Autooptimize then add the above piece of code here
Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:
Disable your plugins one by one, starting with your cache plugins and see if it fixes the issue.
I was having the same issue. In my case, my cache plugin was breaking both the tinymce visual editor and the quick tags in the text editor.
To fix both, I excluded the following JS scripts in my cache plugins:
js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js
If you use Autooptimize then add the above piece of code here
Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:
In my case autooptimize was breaking both the tinymce visual editor and the tags in the text editor.
To fix both, exclude the following scripts from your cache plugins:
js/tinymce, js/backbone.min.js, js/underscore.min.js, js/comment-reply.min.js
If you use Autooptimize then add the above piece of code here
Settings > Autooptimize > JavaScript Options > Exclude scripts from Autoptimize:
Hello!
Now I have topic titles:
<title>Topic Title - Domain.com</title>
How can I customize topic titles to:
<title>Topic Title - Forum Title - Domain.com</title>
Hiya. I’m wondering where in the code the choice of template to use is made, when a forum is created.
I want bbPress to choose to use the Topic Discussion page template for its Forum page — the page that is created with the discussion itself for a topic — when it creates a new Forum….how do I get it to use that template instead?
I do not need a page that lists all topics for a forum; this is being built to be a one-topic forum; having a list of topics when there will only ever be one topic is just more clicking for my users to have to do, to get to the actual discussion.
I only want the discussion of the topic itself to populate, not a list of topics which is what the forum template does now.
Thoughts?
I need help with this plugin bbPress Moderation By Ian Stanley https://wordpress.org/plugins/bbpressmoderation/
i use this to hold topics for moderation from my participants before publishing them, because not all topic i will want to publish. but the thing with this plugin is that it hold but topics and reply for moderation and has no option to separate them.
Is there any way like code that i can use to prevent topics from being moderated, only post should be held for moderation and the reply should not be held.
Thank alot it worked fine,
first when i put the code in functions file, it break my site and it was off, i deleted it from cpanel.
i later created a plugin added to code to it and activate and it worked fine. thanks.
add this to your functions file
function rew_min_length ($reply_content) {
if (strlen($reply_content)<61) {
bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 60 characters.', 'bbpress' ) );
}
return $reply_content ;
}
add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
sorry, that’s how it works in bbpress.
But if you do get to someone who has coded, please post the result back here to help others.
my style pack plugin has a button you can add to the pages to make it clearer
bbp style pack
once activated go to
dashboard>settings>bbp style pack>Buttons