Skip to content

Instantly share code, notes, and snippets.

@adamlaki
Created December 8, 2018 06:36
Show Gist options
  • Save adamlaki/a2f70c9cbaf8c741c25a5f4f2ec8fa10 to your computer and use it in GitHub Desktop.
Save adamlaki/a2f70c9cbaf8c741c25a5f4f2ec8fa10 to your computer and use it in GitHub Desktop.
Trim Any Text In WordPress by Words With wp_trim_words()
<div class="list-item">
...
<p class="list-item__excerpt">
<?php echo wp_trim_words( get_the_excerpt(), 25, '...' ); ?>
</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment