How to use substr() with the_content() in wordpress ?

Try this one

$content = get_the_content();
$content = strip_tags($content);
echo substr($content, 0, 100);

No comments:

Post a Comment