the code is still in your site !
Then I’d suggest you contact your theme author who is controlling this code and ask them for help.
Otherwise beyond my free help to work out all the code you would need.
deleting the code will return it – close and re-open your browser to get the css to take effect
that code changed all my background color for my blog and pages black when it used to be white. Now I cant see anything and deleting the code did not set it back to normal. What do I do to get my site back to the way it was?
I use X theme and now it’s all messed up. It has black background with black font on ALL my blog posts.
For now I changed my whole sites default background to white, the header white, and the header menu font to black so you can read it. It was the opposite, and I like the black header background better the way I had it. I don’t know what that code did, but it messed a lot of stuff up.
That worked except one problem:/ It turned my main menu bar for my site white as well, turned all the background on my site to black in every area including my blog which I need to be a white background.
I don’t want the code to override everything, JUST my forum background.
Thanks
ah, found out what I have done wrong
can you change the code to
add_action ('bbp_theme_after_reply_author_details', 'rew_display_date');
add_action ('bbp_theme_after_topic_author_details', 'rew_display_date');
function rew_display_date () {
?>
<span class="bss-reply-post-date"><?php bbp_reply_post_date(); ?></span>
<?php
}
Hello,
the first code to hide the bbp-topic-post-date works. Adding the second code to the functions.php and checking the topics / reply the bbp-topic-post-date is nowhere visible..
What else can i try?
I copied the code from the bbpress template and it worked perfect. Thanks!
Oh thanks great. My bbpress version was edited so that button is not added to the form. But i guess i have to add it with some code. Thanks
Additionally, as an example of how you can add pretty much anything you want to the JSON responses returned by the REST API:
function bbpress_rest_api_replies_extra_data( WP_REST_Response $response ) {
if ( ! is_array( $response->data ) ) {
return $response;
}
foreach ( $response->data as $key => $single_item ) {
// Only modify replies
if ( bbp_get_reply_post_type() !== $single_item['type'] ) {
continue;
}
// Add the author's details using a custom format
$author_id = get_post( $single_item['id'] )->post_author;
$author = get_user_by( 'ID', $author_id );
$response->data[ $key ]['author'] = "{$author->display_name} <{$author->user_email}>";
}
return $response;
}
add_filter( 'rest_request_after_callbacks', 'bbpress_rest_api_replies_extra_data' );
You could say this is a bit of a brute force hack and although when combined with my last snippet it successfully adds the author’s display name and email address to replies (not topics), it shouldn’t really be used for that purpose “as is”: it doesn’t escape the author details, you probably don’t want to expose their email addresses, plus it’s out of alignment with how author meta is returned for other post types … However, I felt it was worth sharing an example of how you can quite quickly add arbitrary fields to REST API output.
What do you know, it worked!
So getting back to business – thanks for catching that error in my earlier snippet, Robin. I think yours is perfectly fine (also, great links re adding author meta) but just to ‘close the circle’ on my own snippet, here’s a revision:
function bbpress_enable_rest_api() {
$types = array(
bbp_get_reply_post_type(),
bbp_get_forum_post_type(),
bbp_get_topic_post_type(),
);
foreach ( $types as $slug ) {
$definition = (array) get_post_type_object( $slug );
$definition['show_in_rest'] = true;
$definition['rest_controller_class'] = 'WP_REST_Posts_Controller';
register_post_type( $slug, $definition );
}
}
add_action( 'bbp_register_post_types', 'bbpress_enable_rest_api', 11 );
to hide the date at the top, put this in your css
.bbp-reply-post-date {
display: none;
}
Then to add to the list add this to your functions file
add_action ('bbp_theme_after_reply_author_details', 'rew_display_date');
add_action ('bbp_theme_after_topic_author_details', 'rew_display_date');
function rew_display_date () {
?>
<span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span>
<?php
}
whilst in the forums list a sub private forum will not show, if the sub forum is set to public, then searches would show as the forum it belongs to is private.
So set every forum that you wish to be private to Private
If you don’t want the word private to appear – and I hate it showing! – then you can add this to your functions file
add_filter('private_title_format', 'ntwb_remove_private_title');
function ntwb_remove_private_title($title) {
return '%s';
}
or add my plugin which has this and many other features
https://wordpress.org/plugins/bbp-style-pack/
and set this to hide in
dashboard>settings>bbp style pack>forum display item 4
ok, having all results on one page might give you issues.
bbpress will by default show the number of replies per page that is set in
dashboard>settings>forums>Topics and Replies Per Page>Replies
You could up that to say 100, so that you get a decent chuck. But this would change it for forums as well.
However if you wanted that just for search, so not affecting forums, then you could set it as a filter in your functions file – if you know how to add code to your functions file, then come back and I’ll give you some code. Again I would recommend that you set a limit but it can be as high as you like.
Hey everyone! Guess what?
bbPress 2.6, Release Candidate 3, is now available for testing.
Download it from here: https://downloads.wordpress.org/plugin/bbpress.2.6-rc-3.zip
Why is this cool? For starters, @jeffr0 may finally climb down off my back and stop giving me grief for how long it’s been since we shipped a major release.
bbPress 2.5.0 in 2014, 3 years ago.
Most people wouldn’t be proud to say that, but… I am. The 2.5 branch of bbPress has been so stable & well received, we were able to take our time with 2.6 and double-down on upstream improvements to WordPress.
bbPress 2.6 will come with:
* Per-forum moderators
* Improved favorites & subscriptions management
* Improved BuddyPress integration
* Performance improvements across the board
* UX improvements to meta-boxes and admin-area tools
* Tighter integration with WordPress’s Dashboard
* Template tweaks & clean-up
* About 110 other things
If you’re going to test 2.6 on a live site, maybe don’t just yet. It runs a database upgrade routine to migrate favorites & subscriptions from usermeta to postmeta, and for large forums that may take a while or possibly lock things up for a bit.
We are already running 2.6 here and on bbPress.org, so enjoy the speedier new posting experience, and we’ll let you know when the next beta is ready!
Just to let you know that this issue was fixed by uninstalling the plugin “bbPress Login Register Links On Forum Topic Pages” and instead adding a login/logout link using the code provided here:
Layout and functionality – Examples you can use
and then adding code provided to make sure the links only appear in the forum and not the whole site:
change line 3 to
if ( is_user_logged_in() && is_bbpress() ) {
and line 6 to
elseif ( !is_user_logged_in() && is_bbpress() ) {
Hi there @iprg,
Sorry, but there isn’t yet. It wouldn’t be too difficult for us to implement this feature inside of wp-admin, though.
Are you comfortable creating a feature request over at https://bbpress.trac.wordpress.org? If so, that’s the best place to log this idea, and we’ll try and get it into a future release.
I think I understand the expectation here, but that isn’t how it’s currently designed to work.
More specifically, bbPress subscriptions do not discriminate against the user’s current role. If they were subscribed before, they’ll be subscribed until they unsubscribe.
To achieve the behavior you desire, a plugin could be written that either:
- Filters
bbp_topic_subscription_user_ids and removes users with/out desired roles
- Filter
bbp_set_user_role and permanently delete all subscriptions when the new role matches one that qualifies
Maybe a combination of both of the above, if you need to account for already removed users, but want to clean-up future role changes.
ok, so
create a directory on your childtheme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your childtheme
find
wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-reply.php
bbPress will now use this template instead of the original
and you can amend this
so amend this file – copy it to your Pc and use norepad or similar
around line 70 you will see
<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) ) : ?>
replace this with
<?php
$user_id = wp_get_current_user()->ID;
$topic_id = bbp_get_topic_id() ;
$topic_author = bbp_get_topic_author_id( $topic_id ) ;
$is_topic_author = ($topic_author == $user_id ? true : false) ;
if ( bbp_allow_topic_tags() && current_user_can('assign_topic_tags' ) && ($is_topic_author || bbp_is_user_keymaster() ) : ?>
This is untested, and if it doesn’t work – do come back !
This codex article is quite comprehensive about how to fight SPAM. (https://codex.bbpress.org/getting-started/forum-moderation/dealing-with-spam/)
However, although it acknowledges profile SPAM, it fails amongst the many solutions to actually identify a method that is targeted at battling profile SPAM. You could switch to manual registration approval (which would be a pain in any moderate to high traffic site), but that would not solve the problem since the approved user can still post links in their profile.
Akismet, WangGuard, etc, appear to only work on post/comment spam, not on profile spam, no?
I don’t even have discussions enabled or commenting enabled so I don’t even care about post/comment spam!
So as far as I can tell there is no plug-in or feature that will prevent profile SPAM. Someone please tell me I’m wrong!
untested, but this should do it, come back if not
change line 3 to
if ( is_user_logged_in() && is_bbpress() ) {
and line 6 to
elseif ( !is_user_logged_in() && is_bbpress() ) {
your theme is re-writing the classes used by bbpress.
Put this into the custom css – either of your theme if it has a custom css area, or into the custom css tab in my style pack plugin settings
.x-bbp-search-form {
background-color: #ffffff !important;
}
.bbp-forums ul, li {
background-color: #ffffff !important;
}
Hi and thanks for your quick answer.
I have child theme and I can copy bbpress theme inside it.
I’d be thankful if you tell me how can I use these codes.
Please consider that I want to let Keymaster and topic owner to edit topic tags.
Hi,
you provide code to add login and logout links on bbpress layout and functionality, which is just what i need.
Question: Is there any way for it to only appear in my forum http://www.apis.de/forum (and all sub urls) but not on the rest of my site?
Quick solution but not really what i’m looking for (i’m looking to add a function as a real menu option).
I order to add a Like option to the BBPress header menu in topics and replies I resorted to this quick solution (not perfect yet):
<span class="bbp-admin-links">
<?php echo get_fav_or_unfav_button_for_bpp(); ?>
</span>
Add after <?php bbp_reply_admin_links(); ?> in loop-single-reply.php
More info: https://bbpress.org/forums/topic/integrating-buddypress-favorite-system-aka-like-system-with-bbpress/
I order to add a Like option to the BBPress header menu in topics and replies I resorted to this quick solution (not perfect yet):
<span class="bbp-admin-links">
<?php echo get_fav_or_unfav_button_for_bpp(); ?>
</span>
Add after <?php bbp_reply_admin_links(); ?> in loop-single-reply.php
But mission accomplished, the integration of the Buddypress Favorite system with BBPress is complete.
