WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. CottonIJoe
    Member
    Posted 6 years ago #

    Hello,
    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
    Member
    Posted 6 years ago #

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

    http://codex.wordpress.org/Plugin_API

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

  3. Kafkaesqui

    Posted 6 years ago #

    Just pull it from the $post object:

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

    Or use, get_the_content()

Topic Closed

This topic has been closed to new replies.

About this Topic