Will any of your plugins allow for a setting that limits the number of characters in a BuddyPress Activity Post and add a “Read More” button/lin after it?
Hi Steven,
Thank you for the question.I am assuming you are looking to change thee excerpt length in the activity stream(activity posts list)?
It is simple doable by 2-4 lines of code without any plugin. We are also including it in one of our upcoming plugins for a no-code solution.
Please confirm me if this is the case and I will post the code.
Regards
BrajeshSure,
Here you go./** * Changes length of activity excerpt. * * @param int $length_in_chars number of character for the excerpt. * * @return int */ function buddydev_custom_activity_excerpt_length( $length_in_chars ) { $length_in_chars = 20;// change it to as many characters as you want. return $length_in_chars; } add_filter( 'bp_activity_excerpt_length', 'buddydev_custom_activity_excerpt_length', 100 );
Please feel free to change the number of characters.
Regards
BrajeshThat caused a crtical error and crashed the site. 🙁
Hello Steven,
Please ignore my last message. Please let me know have you copied code direct from email?. If yes please copy the code forum and then give it a shot. If issue still persists, Please share your whole “bp-custom.php” file code through pastebin.
Regards
Ravi
The topic ‘ [Resolved] Limit Characters in BuddyPress Activity Post’ is closed to new replies.