Support » Fixing WordPress » the_content not showing the content

  • my client’s website is not showing any content where the_content() is called, but DOES show the_excerpt()…

    anyone have any idea what she’s done wrong?

    Thanks Much,

Viewing 6 replies - 1 through 6 (of 6 total)
  • I learned a lot from this:
    Find out which template produces the view you are looking at and then check if it really uses the_content
    index.php usually controls the “frontpage” and single.php the individual posts display.

    well, when i change the_content() to the_excerpt() in index.php, the_excerpt() works, so i’m wondering why the_content() is not getting any content…

    Did it never work?
    Did it change after an update?
    Did it change after installing a new plugin?
    What happens when you click the post header? Does the post expand to the full post then?
    If possible a link would be helpfull.

    This is strange. I just noticed I have a similar problem. the_content() works on a single post but not on a page. I added the text “content should be here” in my page.php so I know which template is being used.


    Will report back how I fixed this.

    I’ve found that using echo $post->post_content in place of the_content() shows the content. This is a temporary fix and now I’ve got to figure out why the_content() and the_excerpt() are not working.

    Try calling setup_postdata($post) , as detailed here:

    Some post-related data is not available to get_posts by default, such as post content through the_content(), or the numeric ID. This is resolved by calling an internal function setup_postdata(), with the $post array as its argument:

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘the_content not showing the content’ is closed to new replies.