WordPress.org

Ready to get started?Download WordPress

Forums

the_content() mysterious behaviour (7 posts)

  1. haZe
    Member
    Posted 9 years ago #

    My first post on these fora. :)

    I need to include(); wordpress into a larger site. I stripped down the template index.php file to what I needed, and the include() works fine... almost!

    Everything is included, except the most important bit of them all: the post content! I can't explain there two things:

    1. opening the wordpress files directly everything works fine
    2. using the_excerpt() instead works too

    Is the_content() non-includable?

    Thanks in advance :)

    P.s. please excuse my poor english...

  2. Kafkaesqui

    Posted 9 years ago #

    How are you "including" WordPress itself in your document? Are you performing an include on wp-blog-header.php before incorporating any template tags, etc?

  3. haZe
    Member
    Posted 9 years ago #

    I'm including wordpress/index.php . I've obviously changed che include path towards wp-blog-header.php to reflect the new condition.

    The really bizarre thing is that everything works (from post title, to author, etc.) except the_content()

  4. haZe
    Member
    Posted 9 years ago #

    Any ideas? :(

  5. Kafkaesqui

    Posted 9 years ago #

    Only if were not properly including wp-blog-header.php. Once that's available all of WordPress' functionality should be, including post content.

    As a test, try this in your file where the post is being displayed:

    <?php echo $post->post_content; ?>

  6. haZe
    Member
    Posted 9 years ago #

    Hey, cool! Works fine. :)

    I think that I don't need the other extras of the actual function, so I'll be fine with this hack. Doesn't explain the problem though...

    Thanks again. :)

  7. vkaryl
    Member
    Posted 9 years ago #

    I think you need to call wp-blog-header.php inside your page before you use an include for other stuff.... seems like I had to use the include line in index.php before running CG-Feedread later in the page when I was using it....

Topic Closed

This topic has been closed to new replies.

About this Topic