How can I add topic excerpt content to the bbpress topic list
I only saw the topic title
Author name
And date but I couldn’t figure out how to add the topic excerpt into the topic widget please help
you can only merge topics in bbpress, so yes merge two topics
found and fixed.
I’ve put the fix in my style pack plugin version 4.5.0
bbp style pack
once activated go to
dashboard>settings>bbp style pack>bug fixes
or put this in your child theme’s function file – or use
Code Snippets
add_filter ('bbp_get_topic_merge_link', 'rew_get_topic_merge_link' , 10 , 3) ;
add_filter ('bbp_is_topic_merge' , 'rew_is_topic_merge' ) ;
function rew_get_topic_merge_link( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'id' => 0,
'link_before' => '',
'link_after' => '',
'merge_text' => esc_html__( 'Merge', 'bbpress' ),
), 'get_topic_merge_link' );
// Get topic
$topic = bbp_get_topic( $r['id'] );
// Bail if no topic or current user cannot moderate
if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
return;
}
$uri = add_query_arg( array( 'action' => 'bbp-merge-topic' ), bbp_get_topic_edit_url( $topic->ID ) );
$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after'];
// Filter & return
return apply_filters( 'rew_get_topic_merge_link', $retval, $r, $args );
}
function rew_is_topic_merge() {
// Assume false
$retval = false;
// Check topic edit and GET params
if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-merge-topic' === $_GET['action'] ) ) {
return true;
}
// Filter & return
return (bool) apply_filters( 'rew_is_topic_merge', $retval );
}
i try to post my video on bbpress forum but admin panel show video but after posting on forum post video not showing , show like this
[video width="1920" height="1080" mp4="https://forum.eroticalife69.com/wp-content/uploads/2020/04/aliz-nbp_aleska-d-nbp_v_bg_01_trailer01_hdv.mp4"][/video]
what i need to do
Halo!
I’m looking for a way to show the 10 most viewed topics in the last month. I have 20 sub-forums and about 50 responses per day. Important – do not load the server too much.
Ideally, if the list should be formed once a day, but not for each visitor.
I did not find among standard methods. Maybe there is a plugin (widget)?
“BbPress Popular Topics” for over 3 years. Seems no longer working.
Thank you for the tip Robin. I believe I have done this correctly, in my menus I removed the custom link and inserted the actual forums page, and from what I can see it still has the title Archive: Forums along with the description of bbPress Forums below that… any other tips I can try?
Thanks again for all of your help
I’ve sorted my problem by using the built in bbpress widget and displaying it with one topic only.
Hi guys,
Quite simply the “favorites” button does not show beside the subscribe button on any topic or forum on my site.
I have deactivated – reactivated bbPress. Tried the Twenty Seventeen Theme. Nothing has worked.
I have the latest WordPress version 5.4
I have bbPress version 2.6.4
My site is https://fashioncollaborate.com but you wont be able to see anything unless you are a subscribed member. I can provide admin credentials privately?
Hi @robin-w
Thank you for quick reply and code. I placed the code to customizer and it looks little better, however the width of the search form is still half of the area. Is it possible to display 100% width? BTW, the search form is displayed automatically without any shortcode. Here is my bbpress installation.
Thanks again.
Etchbee
I would like to display all topic tags list but I could not find the widget ot shortcode so please help me out here
Hi Robin,
Those that relate to BBpress are:
Advanced noCaptcha & invisible Captcha
bbP private groups
bbp style pack
bbPress Login Register Links On Forum Topic Pages
bbPress Messages
bbPress Unread Posts v2
LoginPress – Customizing the WordPress Login
WP User Avatar
I’m sure your next suggestion will be to disable them all, which I am happy to do if necessary, The forum is not publicly visible yet. I was just hopeful the OP may have already found the problem 🙂
Let me know if that’s the direction you would like me to go.
Best regards,
John
Hi!
I have a solution.
In wp-content/plugins/bbpress/templates/default/js/reply.min.js
replace (d.scrollHeight) with (64)
that’s it.
my email for more question if you have:
mehrankh1913@gmail.com
Put this in your child theme’s function file – or use
Code Snippets
function rew_get_topic_split_link( $retval, $r, $args ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'id' => 0,
'link_before' => '',
'link_after' => '',
'split_text' => esc_html__( 'Split', 'bbpress' ),
'split_title' => esc_attr__( 'Split the topic from this reply', 'bbpress' )
), 'get_topic_split_link' );
// Get IDs
$reply_id = bbp_get_reply_id( $r['id'] );
$topic_id = bbp_get_reply_topic_id( $reply_id );
// Bail if no reply/topic ID, or user cannot moderate
if ( empty( $reply_id ) || empty( $topic_id ) || ! current_user_can( 'moderate', $topic_id ) ) {
return;
}
$uri = add_query_arg( array(
'action' => 'bbp-split-topic',
'reply_id' => $reply_id
), bbp_get_topic_edit_url( $topic_id ) );
$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after'];
// Filter & return
return apply_filters( 'rew_get_topic_split_link', $retval, $r, $args );
}
add_filter ('bbp_get_topic_split_link', 'rew_get_topic_split_link' , 10 , 3) ;
function rew_is_topic_split() {
// Assume false
$retval = false;
// Check topic edit and GET params
if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-split-topic' === $_GET['action'] ) ) {
$retval = true;
}
// Filter & return
return (bool) apply_filters( 'rew_is_topic_split', $retval );
}
add_filter ('bbp_is_topic_split' , 'rew_is_topic_split' ) ;
and come back and confirm that it works
Hello,
I am using the latest version of wordpress (5.4) and the most recent version of bbPress (2.6.4)
Website: ticsandthoughts.com
I am using the Responsive theme.
I am extremely new to all of this, so apologies if this is a dumb question. I recently set up a forum through bbPress and am wanting to remove the top text on the page “Archive: Forums”, as well as the text description “bbPress forums”.
Here’s a link to how it looks right now: https://ticsandthoughts.com/forums/
Thanks so much in advance!
Alex
I’m trying to get single topic titlt but I was u unable to find it in the bbpress template folder
I’m trying to display topic in list form
Like this website nairaland.com
If you check all the forum categories you will notice all topics are in list form
Is there a way to achieve this on bbpress
@robin-w Thanks. I don’t have time to test myself right now.
I wonder why the authors are not responding again to again of these issues? After all they are the developers and it seems like one big huge leap with this version and then it appears nothing? I thought there were several authors of bbpress? It seems unfair that 99% of the user support is coming from you. What a strain on you!
Thanks though!
bbPress version 2.6 and wordpress 5.4
@clivesmith – had a think about guest posters – we can’t show the post, as by definition they are not logged in, so unless you show all moderation replies to all users (which defeats the purpose of moderation 🙂 ) they won’t see the post.
bbpress doesn’t have the functionality that chuckie shows for topics above.
I’ll try and see if I can work some code as I dig further into this, but no promises 🙂
If any one can assist me with this
I’ve had a play this evening with this issue.
This code is very rough and ready, but if it works as I think it does, then it shows pending REPLIES to the user who posted them and moderators and keymasters. NOT topics !!
so when a user posts a reply and it goes into moderation, they see there reply in the topic with a warning.
If you want to try it, put this in your child theme’s function file – or use
Code Snippets
add_filter ('bbp_has_replies' , 'rew_has_replies' ) ;
function rew_has_replies( $args = array() ) {
/** Defaults **************************************************************/
// Other defaults
$default_reply_search = bbp_sanitize_search_request( 'rs' );
$default_post_parent = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
$default_post_type = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
$default_thread_replies = (bool) ( bbp_is_single_topic() && bbp_thread_replies() );
// Default query args
$default = array(
'post_type' => $default_post_type, // Only replies
'post_parent' => $default_post_parent, // Of this topic
'posts_per_page' => bbp_get_replies_per_page(), // This many
'paged' => bbp_get_paged(), // On this page
'orderby' => 'date', // Sorted by date
'order' => 'ASC', // Oldest to newest
'hierarchical' => $default_thread_replies, // Hierarchical replies
'ignore_sticky_posts' => true, // Stickies not supported
'update_post_term_cache' => false, // No terms to cache
// Conditionally prime the cache for all related posts
'update_post_family_cache' => true
);
// Only add 's' arg if searching for replies
// See https://bbpress.trac.wordpress.org/ticket/2607
if ( ! empty( $default_reply_search ) ) {
$default['s'] = $default_reply_search;
}
// What are the default allowed statuses (based on user caps)
if ( bbp_get_view_all( 'edit_others_replies' ) ) {
// Default view=all statuses
$post_statuses = array_keys( bbp_get_topic_statuses() );
// Add support for private status
if ( current_user_can( 'read_private_replies' ) ) {
$post_statuses[] = bbp_get_private_status_id();
}
// Join post statuses together
$default['post_status'] = $post_statuses;
// Lean on the 'perm' query var value of 'readable' to provide statuses
} else {
//get public and pending (not sure if we need this or just to remove the perm status that was here ?
$post_statuses = array_keys( rew_get_topic_statuses() );
}
/** Setup *****************************************************************/
// Parse arguments against default values
$r = bbp_parse_args( $args, $default, 'has_replies' );
// Set posts_per_page value if replies are threaded
$replies_per_page = (int) $r['posts_per_page'];
if ( true === $r['hierarchical'] ) {
$r['posts_per_page'] = -1;
}
// Get bbPress
$bbp = bbpress();
//now filter the query before execution
// Add filter if participant
$user_id = get_current_user_id() ;
$role = bbp_get_user_role( $user_id );
if ($role == 'bbp_participant' || $role == 'bbp_moderator' || bbp_is_user_keymaster($user_id)) {
add_filter( 'posts_where', 'rew_where' );
}
// Call the query
$bbp->reply_query = new WP_Query( $r );
// Remove filter
if ($role == 'bbp_participant' || $role == 'bbp_moderator' || bbp_is_user_keymaster($user_id)) {
remove_filter( 'posts_where', 'rew_where' );
}
// Maybe prime the post author caches
if ( ! empty( $r['update_post_family_cache'] ) ) {
bbp_update_post_family_caches( $bbp->reply_query->posts );
}
// Add pagination values to query object
$bbp->reply_query->posts_per_page = (int) $replies_per_page;
$bbp->reply_query->paged = (int) $r['paged'];
// Never home, regardless of what parse_query says
$bbp->reply_query->is_home = false;
// Reset is_single if single topic
if ( bbp_is_single_topic() ) {
$bbp->reply_query->is_single = true;
}
// Only add reply to if query returned results
if ( ! empty( $bbp->reply_query->found_posts ) ) {
// Get reply to for each reply
foreach ( $bbp->reply_query->posts as &$post ) {
// Check for reply post type
if ( bbp_get_reply_post_type() === $post->post_type ) {
$reply_to = bbp_get_reply_to( $post->ID );
// Make sure it's a reply to a reply
if ( empty( $reply_to ) || ( bbp_get_reply_topic_id( $post->ID ) === $reply_to ) ) {
$reply_to = 0;
}
// Add reply_to to the post object so we can walk it later
$post->reply_to = $reply_to;
}
}
}
// Only add pagination if query returned results
if ( ! empty( $bbp->reply_query->found_posts ) && ! empty( $bbp->reply_query->posts_per_page ) ) {
// Figure out total pages
if ( true === $r['hierarchical'] ) {
$walker = new BBP_Walker_Reply();
$total_pages = ceil( $walker->get_number_of_root_elements( $bbp->reply_query->posts ) / $bbp->reply_query->posts_per_page );
} else {
// Total for pagination boundaries
$total_pages = ( $bbp->reply_query->posts_per_page === $bbp->reply_query->found_posts )
? 1
: ceil( $bbp->reply_query->found_posts / $bbp->reply_query->posts_per_page );
// Pagination settings with filter
$bbp_replies_pagination = apply_filters( 'bbp_replies_pagination', array(
'base' => bbp_get_replies_pagination_base( bbp_get_topic_id() ),
'total' => $total_pages,
'current' => $bbp->reply_query->paged
) );
// Add pagination to query object
$bbp->reply_query->pagination_links = bbp_paginate_links( $bbp_replies_pagination );
}
}
// Filter & return
return apply_filters( 'rew_has_replies', $bbp->reply_query->have_posts(), $bbp->reply_query );
}
function rew_get_topic_statuses( $topic_id = 0 ) {
// Filter & return
return (array) apply_filters( 'bbp_get_topic_statuses', array(
bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ),
), $topic_id );
}
function rew_where( $where ) {
$user_id = get_current_user_id() ;
global $wpdb;
$posts = $wpdb->posts ;
return $where . " OR (
".$posts.".post_author = ".$user_id."
AND ".$posts.".post_status = 'pending'
) ";
}
add_action ('bbp_theme_before_reply_content' , 'rew_pending' );
function rew_pending () {
$id = bbp_get_reply_id() ;
$status = get_post_status ($id) ;
if ($status == 'pending' ) {
echo '<i><b>This reply is pending review and can only be seen by you and the administrators</b></i>' ;
}
}
hello all .. i have hidden using css bbpress header which shows activity like “this topic was updated by……” because it was useless to me and my forum was not showing forum title in topics pages. However,now i want to show forum title only in header of topics page. please let me know how can i achieve that.
My site link – https://castudyweb.com/ca-final-study-room
hmmm..something is wrong with your site and not bbpress related.
I can only advise that you contact your host provider for support and maybe revert to previous copy.
Hi guys,
I’m also trying to remove @ mentions from Forums and Activity in Groups.
I have successfully removed the @Username from beneath the profile names of buddypress users.
I have both of the following in PHP Functions.
add_filter( ‘bp_activity_do_mentions’, ‘__return_false’ );
and
remove_filter( ‘bbp_make_clickable’, ‘bbp_make_mentions_clickable’, 8 );
Now what happens is, when I type “@” followed by a letter for example “J” for “Jack” it still brings up “Jack” user names but it doesnt actually tag them or turn into a link after selecting one. How do I turn off @mentions entirely so it doesnt bring up user names?
I hope that makes sense.
I am using the latest WordPress 5.4 and the latest Buddypress 5.1.2 and bbPress 2.6.4
Any help would be amazballs:)