Is it possible to use functions.php to get a text snippet around the search term and not the first 55 characters of a post?

I hope I made myself understood.

I would like to receive a text excerpt (25 words before + search term + 25 words after) around the search term found in the database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.