/*Reverse sticky header*/
  1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. Change the group description excerpt length

Change the group description excerpt length

By default, the platform does not have an option to change how many characters or words to show inside the group description. But you can use the following function code to modify the length to your preference. Choose which code you want to use below. Please see:

Note: Make sure to have a complete site backup before proceeding

1. Go to Appearance > Theme Editor.

2. Under Select theme to edit, choose (BuddyBoss Child/whatever theme is active), then click Select.

3. Below Theme Files, select Theme Functions (functions.php).

4. Append the code just before the closing PHP tag “?>”:

Use this code if you want to set how many characters would only show up on the group description. Just change the value of 2000.

add_filter( 'bp_get_group_description_excerpt', 'custom_bp_get_group_description_excerpt', 100, 2 ); function custom_bp_get_group_description_excerpt($excerpt, $group){ $group_link = '... <a href="' . esc_url( bp_get_group_permalink( $group ) ) . '" class="bb-more-link">' . esc_html__( 'View more', 'buddyboss-theme' ) . '</a>'; if ( bp_is_single_item() ) { $group_link = '... <a href="#group-description-popup" class="bb-more-link show-action-popup">' . esc_html__( 'View more', 'buddyboss-theme' ) . '</a>'; } return bp_create_excerpt( $group->description, 2000, array( 'ending' => $group_link ) ); }

Use this code if you want to show the group description fully. 

add_filter( 'bp_get_group_description_excerpt', 'custom_show_entire_bb_get_group_description', 999, 2 ); function custom_show_entire_bb_get_group_description( $excerpt, $group ) { if ( empty( $group ) ) { return $excerpt; } return wpautop($group->description); }

5. Click Update File to save the changes.

Note: Any modifications are considered as custom work already. Know more about our Support Policy here: https://www.buddyboss.com/support-policy/

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

To speak to our Agency consultant, fill in the form found at our Contact Page.

"*" indicates required fields

Get Started

Enter your name and email address to get started with your project...

Name*