Truncating or trimming the length of a string down to a set limit is a task that we do often. Right? You have a blog page and you want to show a snippet of the content, but only 200 or 300 words and not the whole 2000 word articles. WordPress has a function built in that you can use called wp_trim_words(). I have one that I’ve used which is inspired by Laravel and Symfony. It’s part of my Fulcrum plugin that I use on all of my projects. Genesis has one built into too called genesis_truncate_phrase(). There are multiple ways […]
