Created
December 19, 2015 22:11
-
-
Save vladimirlukyanov/58dfa637f3b0c7f27d9a to your computer and use it in GitHub Desktop.
Cut length of content to x symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$content = get_the_excerpt(); | |
if (strlen($content) > 50) { | |
$content = substr($content, 0, 100) . '…'; | |
} | |
print $content; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment