Hello,
the_excerpt() functions retrieves first 55 words if there is no entry in excerpt field and that is OK.
But, get_the_excerpt() function does not get first 55 words of content if there is no entry in excerpt field, but returns empty string.
How is it possible to get first 55 words of contenet in case there is no entry in excerpt field?
Thank you.
Thank you. It has helped.
There is only a small issue when using get_my_excerpt, namely retrieved string contains html codes for special characters (f.e. “ for ").
Try calling the function like this:
$excerpt = html_entity_decode(get_my_excerpt(), ENT_QUOTES, 'UTF-8');
echo $excerpt;
It's good now, thank you.
You're welcome. Glad you got it resolved.
p.s. It would be helpful that Wp function get_the_excerpt() could retrieve first n(55) words of content, if there is no entry in the excerpt field, like the_excerpt() function does so.