I set up a theme in buddypress and i want to have a teaser section for my groups on there. It works fine but i have a problem to shorten the group description…
I’m using it like this:
<p><a href="<?php bp_group_permalink() ?>"><?php bp_group_name() ?></a></p>
<p><?php bp_group_description_excerpt() ?></p>
If there´s a very long group-description it crashes my layout. Is it possible (like in wordpress) to make the excerpt shorter (with a function or something)? Like “maximum of 20 letters”, or something like that?
Thanks.
Custom API
Write a normal API wrapper function for it and place it in your functions.php theme or offer it as (mu-)plugin.
Trim Words
The Template Tag
Usage
Now, just call it like any template tag inside your template:
short_bp_group_descr_excerpt();
.