I get the error message “Oh bother! No topics were found here!”. I have installed bbpress and working on a divi theme. My shortcode for forum works but not my topics or index short code and I get this error. https://motionspecificrelease.ca/msr-community/
tools.php
function bbp_admin_repair_user_favorites() {
643 $values[] = "('{$user->user_id}', '{$key}, '{$favorites_joined}')";
Should be
function bbp_admin_repair_user_favorites() {
643 $values[] = "('{$user->user_id}', '{$key}','{$favorites_joined}')";
You can put a default IP for all registered activity:
add_filter( 'bbp_current_author_ip', function() {
return '127.0.0.1';
} );
127.0.0.1 is the default ip in this case.
@atmojones @slomeli79 @cjerrells
Can one of you give me a bit more instruction on where and how to enter this code? I get a syntax error when checking this code…
A little help would be hugely appreciated!
Code goes into the file functions.php that you can find on Appearance – Editor – Function.php. Open the file and paste it at the end. Just be careful because depending the theme code it can work fine or break your wordpress (if it breaks the wp just remove the code using cpanel or ftp).
The code allow you to upload featured image for bbpress forums. Then you can give it css style for a better looking.
To do this you need administrator access.
Thanks, Arutam!
I love Yoast. But, to be able to upload an image for sharing networks, doesn’t that require being able to access a URL in the Page editor? I think that’s the problem I’m having is there’s no way for me to do that. Does using this code supply that function?
And, where does the code get installed? I’m not a dev at all, so most of my knowledge is plug-and-play.
With follow code you can upload a featured image for forums… But if you want a good looking image on social networks I recommend you install Yoast (for example) to upload a custom image for share options.
/* Add Featured Image to bbPress Forums */
add_post_type_support('forum', array('thumbnail'));
function ks_forum_icons() {
if ( 'forum' == get_post_type() ) {
global $post;
if ( has_post_thumbnail($post->ID) )
echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
}
}
add_action('bbp_theme_before_forum_title','ks_forum_icons');
Source Link
Thanks for the follow up. Here is what I did…
- Disabled all plugins except bbpress
- I switched to a WP default theme, ie: twentyfifteen and twentyseventeen
- Did the above with Chrome, Firefox, and MS Edge browsers
Same thing still happens. So with the admin bar disabled, and logging in from the default WP login screen, and with bbpress enabled, I just get redirected to the site’s front page — no admin page. So I still have to add wp-admin/ at the end of the url address to get into the admin area. If I disable bbpress, then everything works normal. Enable it again, goes back to the issue.
As mentioned, I’ve encountered this for at least a couple years. So based on testing, it’s not theme related and not plugin (other plugins) related. Something about bbpress is redirecting after logging in with the default WP login and not sending me directly into the admin.
If there is something coded in bbpress for “Forum logging in” for front-end users, then I can see this being relevant. However, logging into the admin, is the problem.
I would love to know how to hide buttons like login or register when the user is logged in and vice versa for opposite scenarios.
Im surprised that’s not how it functions by default. Why can i access the log in page when im logged in? There should be redirect options for this.
Does anyone have any suggestions that does not involve a ton of code. Remember, that’s the whole point of WP and plugins.
We have a BBPress forum that is behind a membership site, and we give them the capability of subscribing to threads. Our problem is that if a person stops subscribing they no longer have access to the site, and therefore have no way of unsubscribing from a topic.
Is there a way that we can generate a script/link to force an automatic unsubscribe from all topics when removing the user? Even if we need to manually create the link, it would be an improvement.
I can generate code if necessary-just don’t know where to start.
Thanks,
Bob
FYI I’m using version 4.9.6 of wordpress and version 2.5.14 of bbPress.
I added custom code to my theme functions.php page to add customized roles for bbPress. The roles show up when I edit users and want to change their roles, but when I go to save it, they just default back to a participant role. How can I fix this? Here is the code I used below:
/* bbPress Custom Roles */
function add_custom_role( $bbp_roles ) {
$bbp_roles['my_custom_role2'] = array(
'name' => 'Producer',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
$bbp_roles['my_custom_role3'] = array(
'name' => 'Engineer',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
$bbp_roles['my_custom_role4'] = array(
'name' => 'Songwriter',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
$bbp_roles['my_custom_role5'] = array(
'name' => 'Staff',
'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
);
$moderator = bbp_get_moderator_role() ;
$bbp_roles[$moderator] = array(
'name' => 'Moderator',
'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
);
$keymaster = bbp_get_keymaster_role() ;
$bbp_roles[$keymaster] = array(
'name' => 'Chief Executive Officer',
'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster
);
$apprentice = bbp_get_participant_role() ;
$bbp_roles[$apprentice] = array(
'name' => 'Member',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
);
return $bbp_roles;
}
add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
@michent1 – thank you – your updated version + the original shortcode by op works as a charm (had some issues with the original one).
I fixed it like this.
1. make css folder in wordpress>wp-content>theme>[mytheme]
2. cp wordpress>wp-content>plugins>bbpress>templates>default>css>bbpress.css wordpress>wp-content>theme>[mytheme]>css
3. add these code lines in the css file.
#bbpress-forums fieldset.bbp-form input[id=bbp_anonymous_email]{ display: none; }
4. cp wordpress>wp-content>plugins>bbpress>templates>default>bbpress>form-anonymous.php wordpress>wp-content>theme>[mytheme]>bbpress
5. fix any email address in email textfield. Edit the form-anonymous.php
<input type=”text” id=”bbp_anonymous_email” value=”guest@guest.com” ….
Robin,
Apologies for the late response – I have been away for a while.
I’m happy to say that your revised css code does that job nicely!
Many thanks,
Geoff
Is anyone know what is the code to display last reply by: username in topics?
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?
array(‘post’, ‘page’, 'release')
ok got it! since i am not that much into codes,
could you please tell me where i have to add the post type if the post type is “release” for example:
/** Only process for post types we specify */
if( !in_array( $post->post_type, apply_filters( ‘bbppt_eligible_post_types’, array( ‘post’, ‘page’ ) ) ) ) {
return;
thank you very much for your help 😉
In one of the topics for posts files there is a statement that defines what post types it works for.
Updated: in index.php look for
/** Only process for post types we specify */
if( !in_array( $post->post_type
and you can add your custom post types in there
after some difficulty I came up with a solution, which allows a standard menu item linking to eg:
forums/users/current
If a request is made to http://mysite/forums/users/current, the user name “current” is detected and replaced with the current user id, or, if the user is not logged in, redirect to login screen:
/*
* attempt to handle generic request for current user
*
* if the url is passed as forums/users/current/
* this function detects that the permalink has been set to bbp_user=current
* and
* - if the user is logged on, the query is changed to the current user
* - if the user is not logged on, the user is redirected to login screen
*
*/
function ink_bbp_request_current_user( $query_vars ) {
if ( isset( $query_vars[ 'bbp_user' ] ) ) {
switch ( $query_vars[ 'bbp_user' ] ) {
case 'current':
if ( get_current_user_id() ) {
$query_vars[ 'bbp_user' ] = bbp_get_current_user_name();
} else {
auth_redirect();
}
}
}
return $query_vars;
}
add_filter( 'bbp_request', 'ink_bbp_request_current_user', 10, 1 );
So this is what I understand from this thread so far, to provide clarity moving forwards:
1. Dynamic reply box that opens next to post replying to in forum is actually already a feature of bbpress, but not for BuddyPress group forums.
2. Some themes seem to not engage this functionality and the way to fix that is to copy the reply.js file into a folder called js that is at the root of child theme.
3. It works with visual editor
So the only problem is that it does not work for Buddypress Group forums. However, @robkk mentioned, earlier in this thread, a patch he made. But he has not been active on these forums for over a year.
https://bbpress.trac.wordpress.org/ticket/2974
It is pretty easy to workaround this issue as well, since all you have to do is enqueue the javascript with a different conditional or enqueue it sitewide, but doing it sitewide might cause another issue somewhere.
Here I just added a bbpress-functions.php file to a twentysixteen child theme. I edited out the conditional causing the issues with groups. You can test this on my test site as well.
You would have to remove the file later if the trac tickets patch I linked to is committed and you are using version 2.6 of bbPress, so that you can have the file enqueued on the pages where it is needed.
https://cloudup.com/czqFBqJE8TE
The trac ticket he mention seems to be resolved yet it’s not working for BP group forums. The link to the code on cloudup is broken.
So that’s the summary of where we are at on this thread… the big question is, does anyone have any insight or can help with enabling the dynamic reply box to BP group forums topics?
Where would I find information on changing the CODE /CODE button in bbpress to act like the wordpress CODE insert?
In other words in bbpress clicking the CODE button gives you`
in WordPress clicking the CODE button gives you < code > < /code >
I’m having an issue with a plugin since it handles how my CODEs are displayed and one or the other is broke pending which settings I use.
I hope that makes sense..
may or may not work – but try
.avatar {
display : none ;
}
#bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar {
display : block !important
}
The original turns it off, and the second turns it on again for topics and replies
in your custom css area try adding
.avatar {
display : none ;
}