WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] the_content() in template always empty (4 posts)

  1. remino
    Member
    Posted 6 years ago #

    Developing a new template, I'm trying to output the content by using the_content(). However, it always displays nothing. However, $post->post_content does contain the unfiltered post content.

    Anything I'm missing?

  2. remino
    Member
    Posted 6 years ago #

    I added a line, setup_postdata($post), in my template, and that did it. I'm surprised I have to do that, since the_title() works just fine, with and without the added line.

  3. Adam Brown
    Member
    Posted 6 years ago #

    Did you start your loop first? Right after the loop begins, do you call the_post()?

    The_Loop

  4. remino
    Member
    Posted 6 years ago #

    Is that what the_post() does? I see...

    I just tried it and it works. Thank you! I guess I still have a lot to learn.

Topic Closed

This topic has been closed to new replies.

About this Topic