How to use substring() function with the_content() in worpress?
I am using this code;
<?php echo substr(the_content(), 0, 5) ?>
but code is not working.
- 6 years ago
You can use this code:
<?php
$content = get_the_content();
$content = strip_tags($content);
echo substr($content, 0, 20);
?>
Hot Questions