$title = get_the_title();
if(mb_strlen($title) > 25){
echo mb_substr($title, 0, 25) . '<span style="color:white; position: relative; bottom: -6px;">・・・</span>';
} else {
echo $title;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter