get_posts not respecting the more attributes (3 posts)

  1. chrisj
    Posted 10 years ago #

    Hi I am retrieving a list of posts using the following code:

    $posts = get_posts('category=12');
    foreach($posts as $post) :
    <?php the_content(); ?>
    <?php endforeach; ?>

    But instaed of only showing content up to the more quicktag it shows the whole page.

    Any ideas why this is?

  2. silpstream
    Posted 10 years ago #

    What sort of page is this? Index? Archive? Page? Post? Category? The codex states:

    If the quicktag <!--more--> is used in a post to designate the "cut-off" point for the post to be excerpted, the_content() tag will only show the excerpt up to the <!--more--> quicktag point on non-single/non-permalink post pages.

    You may want to try the_excerpt() instead.

  3. chrisj
    Posted 10 years ago #

    Cheers, but the excerpt returns a fixed number of characters, I need the specific text that appears before the more quick tag.

    It's a temmplate associated to a specific page that is returning the posts from a specific category. So I'd like to see the text above the more quick tag for all of the posts within that category.

    Does this make sense?

Topic Closed

This topic has been closed to new replies.

About this Topic