Skip to content

Instantly share code, notes, and snippets.

@nicdford
Created March 20, 2018 00:46
Show Gist options
  • Save nicdford/7b5dcf3b44431e590057626aa69578c2 to your computer and use it in GitHub Desktop.
Save nicdford/7b5dcf3b44431e590057626aa69578c2 to your computer and use it in GitHub Desktop.
Create excerpt from variable
/**
* Create excerpt from content
*/
function pac_create_exerpt( $content ) {
return wp_trim_words($content, 15, '...');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment