Important:
This support area is for Kalium 3 users only.
Support for Kalium 4 has moved to our new platform at support.laborator.co.
If you’re using Kalium 4, please create a new account there using your email and license key. A password will be sent to you automatically.
Hi,
I would like to be able to truncate the blog post titles (on the main blog page) so that they each appear as no more than 30 characters followed by an ellipsis ('...').
Is there a way to achieve this, perhaps by adding a function to the functions.php file?
Many thanks,
Chris
Hi Chris,
Can you try out this code, paste it in your functions.php file:
function truncate_the_title_blog( $title ) { if ( is_archive() || is_home() ) { $chars = 30; if ( strlen( $title ) > $chars ) { return substr( $title, 0, $chars ) . '...'; } } return $title; } add_filter( 'the_title', 'truncate_the_title_blog' );Best regards,
Laborator Team
That works a treat, thanks Art!
Glad to hear that GIdsey
Best regards,
Laborator Team