i wanna show 20 chars of the_content
i tried this but doesn't work for me .
<?php $content = '';
$content = the_content();
$count_content = strlen($content);
if($count_content > 20 ) {
$description = substr($content, 0,20,'UTF-8');
echo $description ;
}
else {
echo $content;
}
?>
$content
contains what you think it does? How about runningvar_dump()
on it? – Dan Apr 17 '14 at 17:45