Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Limit title characters


ElevenTwenty2
Member

@eleventwenty2

Here’s what I came up with and it works the way I need it..

I added the following function to the “buddypress/bp-forums/bp-forums-templatetags.php” file.

`function bp_the_short_topic_title() {
echo bp_get_the_short_topic_title();
}
function bp_get_the_short_topic_title() {
global $forum_template;
$topic = $forum_template->topic->topic_title;

if (strlen($topic) > 35)
{
$output = substr($topic, 0, 35).’…’;
}
else
{
$output = $forum_template->topic->topic_title;
}
return apply_filters( ‘bp_get_the_topic_title’, stripslashes($output) );
}`

then just replaced bp_the_topic_title() with bp_the_short_topic_title() where I needed it shortened.

Skip to toolbar