Skip to content

Instantly share code, notes, and snippets.

@awakekat
Created March 27, 2016 22:48
Show Gist options
  • Save awakekat/049e4f50beb2d5c37b44 to your computer and use it in GitHub Desktop.
Save awakekat/049e4f50beb2d5c37b44 to your computer and use it in GitHub Desktop.
Custom WP truncate words
<p><?php
$content = get_the_content();
echo wp_trim_words( $content , '45' ); ?>
<a href="<?php the_permalink(); ?>"> Read More</a></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment