An equivalent of the_content() which only RETURNS the content? (4 posts)

  1. CottonIJoe
    Posted 8 years ago #

    I am trying to get a different result on my page if the length of the_content is greater than a certain number. With the_content echo'ing and not returning values, it ist not possible to run strlen(the_content()). But this is exactly what i would need! Is there a way to directly access the content of a post without echoing it? It HAS to be possible! ;)
    Thanks for your answers!

  2. Adam Brown
    Posted 8 years ago #

    That's why there's a "the_content" filter...


    Not exactly what you're looking for, but should do the trick.

  3. Kafkaesqui

    Posted 8 years ago #

    Just pull it from the $post object:

    global $post;
    $content = $post->post_content;
  4. alakhnor
    Posted 8 years ago #

    Or use, get_the_content()

Topic Closed

This topic has been closed to new replies.

About this Topic