function bbp_title_max_length( $default = ’70’ ) {
echo bbp_get_title_max_length( $default );
}
I am looking for the way to reduce the topic size too. 80 characters generates large ugly URLs. The above solution is not working. Would be cool if someone could help.
There is a filter in place you can use to tweak this, bbp_get_title_max_length
See bbp-core-options.php around line 370 or so.
sorry to bump such a old topic, but can someone show the specifc code to add to child theme functions.php? still learning here…
I tried adding this to functions, but produced an error…
function bbp_title_max_length( $default = 90 ) {
echo bbp_get_title_max_length( $default );
}
/**
* Return the maximum length of a title
*
* @since bbPress (r3246)
* @param $default bool Optional. Default value 90
* @uses get_option() To get the maximum title length
* @return int Is anonymous posting allowed?
*/
function bbp_get_title_max_length( $default = 90 ) {
return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) );
}
thx!
Try this php code snippet. Add it to your child themes functions.php file or in a functionality plugin that can hold custom php code snipppets.
add_filter ('bbp_get_title_max_length','rkk_change_title') ;
Function rkk_change_title ($default) {
$default=90 ;
return $default ;
}
thx Rob, that worked! I understand what u did, but I guess I was confused by Jareds post that stated there was already a filter in options.php for this.