Is there a way to compare the_excerpt() to the_content() to know if the_excerpt() is actually showing the entire post content? for instance, if a post were particularly short.
ultimately i’d like to have a “Read more” link at the end of excerpts. but i want it to say 1 thing for posts and another for posts of the video format (ie… ‘watch the video’ instead of ‘read the rest’). but at the same time i don’t want to manually tack this on after the excerpt, but i have plenty of posts that are short enough they don’t need a ‘read more’ link, since the_excerpt displays the full post.
but adding the permalink to the excerpt_more filter isn’t quite right since it won’t add a link to the video posts that have no other content.
so i’m stuck between the two. i hope that made sense. if it didn’t it’s late and i will try to re-explain in the morning.
What you’re trying to do with the video is exactly what Post Formats were created to handle.
Add this to functions:
And then this to handle your Read More link:
@mrwweb is right, post formats are very useful in most cases.
As a more generic solution you could combine
the_excerpt()
andthe_content()
in one function:In your theme you call now â¦
⦠instead of
the_excerpt();
.