Forum Replies Created
-
In reply to: Freshness is way off
The below should update the “Topic” page and the main “Forum” page.
Once you add the code, you’ll have to add a reply to a topic for it to update. Or run the forum repair Robin W mentioned above.
Add the below code to your
functions.php
file of your theme (preferably child theme), or use the code snippet plugin.if(!function_exists('ticket3297_bbpress_update_latest_activity')){ function ticket3297_bbpress_update_latest_activity( $reply_id, $topic_id, $forum_id ){ $new_time = get_post_field( 'post_date', $reply_id ); if ( ! empty( $new_time ) ) { update_post_meta( $forum_id, '_bbp_last_active_time', $new_time ); } update_post_meta( $forum_id, '_bbp_last_active_id', $reply_id); update_post_meta( $forum_id, '_bbp_last_reply_id', $reply_id ); $forum_obj = get_post( $forum_id ); if( $forum_obj && $forum_obj->post_parent !== 0 && bbp_is_forum_category( $forum_obj->post_parent ) ){ update_post_meta( $forum_obj->post_parent, '_bbp_last_active_id', $reply_id ); update_post_meta( $forum_obj->post_parent, '_bbp_last_reply_id', $reply_id ); if ( ! empty( $new_time ) ) { update_post_meta( $forum_obj->post_parent, '_bbp_last_active_time', $new_time ); } } } add_action( 'bbp_new_reply', 'ticket3297_bbpress_update_latest_activity',10,3 ); } if(!function_exists('ticket3297_bbpress_delete_update_latest_activity')){ function ticket3297_bbpress_delete_update_latest_activity(){ $reply_id = bbp_forum_query_last_reply_id(); ticket3297_bbpress_update_latest_activity( $reply_id, bbp_get_reply_topic_id( $reply_id ), bbp_get_reply_forum_id( $reply_id ) ); } add_action('bbp_deleted_reply','ticket3297_bbpress_delete_update_latest_activity'); add_action('bbp_trashed_reply','ticket3297_bbpress_delete_update_latest_activity'); }
That should run when replying, deleting, and trashing replies.
In reply to: Freshness is way offI’m working on a fix/solution for this, will post it up here in a bit so you can all try it out.
In reply to: Reddit style forumHello,
Easiest way would be to override the bbpress’s
content-single-topic.php
file and movebbp_get_template_part( 'form', 'reply' );
to abovebbp_get_template_part( 'loop', 'replies' );
within that file.For another option, I’ve tried the below on a few different themes without any issues. You’d add the below code to your theme’s
functions.php
file. Best if you add to child theme so that you don’t have to re-add if you update your theme, same would apply for the first option above.if ( !function_exists( 'oscowordpress1_move_bbpress_reply_form_filter' ) ) { function oscowordpress1_move_bbpress_reply_form_filter( $template , $slug , $name ) { if ( is_array( $template ) && in_array( 'form-reply.php', $template ) ) { remove_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10 ); return array(); } return $template; } } if ( !function_exists('oscowordpress1_move_bbpress_reply_form')){ function oscowordpress1_move_bbpress_reply_form( $slug, $name ){ if ( isset( $name ) && $name == 'replies' ) { bbp_get_template_part( 'form', 'reply' ); add_filter( 'bbp_get_template_part', 'oscowordpress1_move_bbpress_reply_form_filter', 10, 3 ); } } add_action( 'get_template_part_loop', 'oscowordpress1_move_bbpress_reply_form', 10 ,2 ); }
Best of luck, and hope one of those work out for you. 🙂
In reply to: [bbp-forum-index] display only 50 forums !The topics & replies within forums you can change in your WordPress admin area at Settings > Forums below “Topics and Replies Per Page”.
If you want to change the displayed forum amount(shortcode you mentioned), try adding the below code to your
functions.php
file of your WordPress theme.if(!function_exists('poco06_bbpress_change_forum_count_display')){ function poco06_bbpress_change_forum_count_display( $args ){ if( is_array( $args ) && array_key_exists( 'post_type', $args ) && $args['post_type'] == 'forum'){ $args['posts_per_page'] = 100; //Change to number of displayed you want } return $args; } add_filter( 'bbp_after_has_forums_parse_args', 'poco06_bbpress_change_forum_count_display' ,10 ); }
That should increase it to 100, change as needed. There might be a plugin for that as well that others may be able to point you to.
🙂
In reply to: Dara theme bbpress help!You could add the below CSS to get your forums off your header and make the forums fill the page width.
You’d want to add the code to
style.css
file, preferably in a child theme so that when you update you don’t have to re-add the code. Or if that theme has a options panel with a area to add custom CSS.body.bbpress .content-wrapper .content-area { max-width: none; padding: 0 7px; } body.bbpress .content-wrapper, body.bbpress.no-sidebar.page .content-wrapper { margin: 0; padding: 0; } body.bbpress .site-content { padding: 30px 0; }
Just thought I’d throw that out there as a option 🙂