Function to display a Wordpress string (e.g. post title or content) with a max number of characters.