Support » Themes and Templates » Change behavior based on post length?

  • Resolved Andrew

    (@andrewkantor)


    Sometimes I write long posts, sometimes I write very short ones. I would like the loop on my blog’s home page to display the entire post (post_content) if it’s, say, 200 characters or fewer, but display the post_excerpt if it’s longer than that.

    Is there a way to code it, something like ‘if post_length < 200 echo the content, otherwise echo the excerpt’?

    I don’t want to set the excerpt length to 200, because sometimes there are links in my short posts and excerpts don’t support that.

    It would seem that pulling the character count would be simple, but it ain’t to me.

    Any suggestions? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change behavior based on post length?’ is closed to new replies.