Forums

Why is the_content() function truncated? (4 posts)

  1. cewyattjr
    Member
    Posted 8 months ago #

    Because I'm setting up a site with a secondary blog, I'm creating up a page template to pull in my blog posts. So I created a page called Blog and a specific template for that page.
    Querying posts like so at the top of the page:
    query_posts('cat=-5,-3,-7' );

    Then the loop:

    <?php while (have_posts()) : ?>
    <?php the_post(); [extra code removed]
    the_content();
    
    	<?php endwhile; ?>

    I'm finding that on this template, I'm only getting an output of maybe 10 or 20 characters. What gives? Is there a obvious setting that I'm missing? I was under the impression from reading the Codex that the_content() would output all a post??

    Thanks!

    Chuck

  2. Fumito Mizuno
    Member
    Posted 8 months ago #

    When you use the_content in non-single pages (ex, category archive), you will get the excerpts of your blog posts.

    http://codex.wordpress.org/Function_Reference/the_content
    http://codex.wordpress.org/Function_Reference/the_excerpt

  3. cewyattjr
    Member
    Posted 8 months ago #

    Aha. OK, thanks Ounziw. I wonder if there's a way to change/trick/hack/workaround that...without resorting to something like
    echo $queried_post->post_content

    ?

    Thanks mucho!!

  4. vtxyzzy
    Member
    Posted 8 months ago #

    There is a global variable - $more that can control whether the more tag is used. When set to zero, the more tag is used. When set to 1, the tag is ignored.

    So, place code like this before calling the_content():

    <?php global $more;
    $more = 1; // Ignore the more tag
    ?>

Reply

You must log in to post.

About this Topic