WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display whole first post and the rest are excerpted (3 posts)

  1. M57
    Member
    Posted 7 years ago #

    Is there any plugin that will allow me to display the entire first post even if i used the <!--more--> tag on it? I want the visitors of my site to see the whole first post, yet can see excerpts for the rest of the posts.

    Is this possible?

    your help is much appreciated

  2. Kafkaesqui

    Posted 7 years ago #

    To force the full display of a post, in place of the_content() use:

    <?php echo apply_filters('the_content', $post->post_content); ?>

    You could simply echo $post->post_content, but the above assures all text formatting and plugin filters are run on the content first.

    To only perform this on the first post on your home page:

    <?php
    if( is_home() && !is_paged() && ($posts[0] == $post) ) {
    echo apply_filters('the_content', $post->post_content);
    } else {
    the_excerpt();
    }
    ?>

  3. manstraw
    Member
    Posted 6 years ago #

    Here it is nine months later, and a new need was born. (get the pun?) I looked for quite a while before I found this helpful thread on how to avoid the_content and it's filering out anything past the more comment. Mucho handy!

    In case anyone cares, I'm actually using the more comment to display a partial post in the sidebar, but I want the full post in the actual category display. Which post displays in the sidebar is controlled partially outside the wordpress system by a program schedule database for an online radio program. In short, the schedule database has a url for the show info, which is a wordpress post. I have a function in wordpress that reads the show database, uses the url there that is the show currently playing, parses out the nedessary data to get the post ID, and then queries to display that show in the sidebar. I only want everything up to the more comment, including any images, in the sidebar. In the show category, I want the full post. The above code snippet was what I was looking for. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.