WordPress.org

Ready to get started?Download WordPress

Forums

the_content not showing the content (7 posts)

  1. glennn
    Member
    Posted 4 years ago #

    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,
    GN

  2. henkholland
    Member
    Posted 4 years ago #

    I learned a lot from this:
    http://codex.wordpress.org/Template_Hierarchy
    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.

  3. glennn
    Member
    Posted 4 years ago #

    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...

  4. henkholland
    Member
    Posted 4 years ago #

    Crazy!
    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.

  5. Josh Stauffer
    Member
    Posted 4 years ago #

    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.

    Example: http://www.jthemes.com/about

    Will report back how I fixed this.

  6. Josh Stauffer
    Member
    Posted 4 years ago #

    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.

  7. ianatkins
    Member
    Posted 4 years ago #

    Try calling setup_postdata($post) , as detailed here:
    http://codex.wordpress.org/Template_Tags/get_posts

    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:

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.