Tagged: buddypress, BuddyPress read more
Hi,
I am sure there must be a setting somewhere, surely, but I can’t find it.In some of our activity posts BP inserts a Read More link after a certain number of characters. We want to increase the number of characters displayed initially so not as many posts have a read more link.
How can this be adjusted?
Thanks,
Dale.HI Dale,
This should most probably work/** * Change length of activity excerpt. * * @param int $length length. * * @return int */ function buddydev_change_activity_excerpt_length( $length ) { return 500; } add_filter( 'bp_activity_excerpt_length', 'buddydev_change_activity_excerpt_length' );
Please give it a try and let me know.
Regards
BrajeshHello Dale,
Use this code either in your active theme ‘functions.php’ file or ‘bp-custom.php’ file.
For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/
Regards
RaviIt wasn’t Dale, it was me @vict0rl0pez, but cleared up and also grateful 😊
I have created the bp-custom.php in wp-content/plugin, I have tried in the theme’s functions.php and in the buddypress-functions.php in /wp-content/themes/community-builder/buddypress, but all of it It gives me an error and blocks me from accessing the page.
Do you know what it could be due to?
Thank you very much again.- This reply was modified 2 years, 6 months ago by Vict0rl0pez.
A mí, no me funciona.
¿Puede haber cambiado algo durante estos 2 años, que puede ser ?
Gracias.even on this route, I have found something that could seem to work … but no !!!
/wp-content/themes/community-builder/includes/buddypress/cb-bp-hooks.php
🙁
Hi Victor,
I am sorry for the trouble.1. When creating a bp-custom.php, Please make sure the opening php tags are present.
Here is an example, that you can copy directly.
2. Please make sure you have not put the code anywhere else as you can not have 2 copies.
Please do that and let me know.
Regards
BrajeshI haven’t had time to put your message into practice yet, thank you very much.
Meanwhile I have found the code that YES it has done./** * Show all activity content instead of the trimmed content with read more. */ function buddydev_show_all_activity_content() { remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); remove_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 ); } add_action( 'bp_init', 'buddydev_show_all_activity_content' ); add_action( 'bp_activity_sent_reply_to_reply_notification', 'buddydev_show_all_activity_content' );
Really thanks for the help and speed!
- This reply was modified 2 years, 6 months ago by Vict0rl0pez.
- This reply was modified 2 years, 6 months ago by Vict0rl0pez.
- This reply was modified 2 years, 6 months ago by Vict0rl0pez.
- This reply was modified 2 years, 6 months ago by Vict0rl0pez.
The topic ‘ [Resolved] Adjusting length of text before Read More link’ is closed to new replies.