Skip to content

Instantly share code, notes, and snippets.

@quangbahoa
Last active January 2, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quangbahoa/8295431 to your computer and use it in GitHub Desktop.
Save quangbahoa/8295431 to your computer and use it in GitHub Desktop.
<?php
$content = get_the_content();
$trimmed_content = wp_trim_words( $content, 40, '<a href="'. get_permalink() .'"> ...Read More</a>' );
echo $trimmed_content;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment