Want one category post show full content but others to show excerpts in loop

How to choose which category post will show full content in the loop and have others still show excerpts ?

  • Patrick
    • Support Monkey

    Hi Annabelle and Joe,

    I think I can lend a hand here. The following will get you going. Insert the code to replace the current call to the_excerpt in your loop, and change the category IDs to match those you want to show the full content.

    <?php if (is_category(array(17,18,19,20,27,28))) : ?>
         <?php the_content(); ?>
    <?php else : ?>
         <?php the_excerpt(); ?>
    <?php endif; ?>

    Hope this helps! :slight_smile:

  • PC
    • WPMU DEV Initiate

    The 2 Methods of Showing Excerpts

    Method 1: The More Tag

    This method is usually the easiest of the two. When you have written your post, select where you would like to make the cut-off between the partial post for the homepage, and the rest of the page, then click the More button ().

    Your homepage, and category pages, will now display only the first section of the post, and a line of text linking to the rest of the article. This line defaults to, “Read the rest of this entry »”, but can be easily changed. Open your index.php template file, and change the following line: (Make sure you retain the quotation marks!)

    <?php the_content('Read the rest of this entry »'); ?>
    Method 2: Post Excerpts Function

    To use the post excerpts function, you will need to edit your template’s files, namely those controlling your home and category pages (These will be home.php and category.php if you have them, and index.php if you don’t). First off, replace the following line:

    <?php the_content('Read the rest of this entry »'); ?>


    <?php the_excerpt(); ?>

    Your pages will now show the excerpt. However, to load the post, your readers will have to click the post title. This isn’t optimal (Why force your readers to scroll back upwards, to continue reading onwards?) . To solve this, we will add a link below the content, which can be used to load the rest of the article, similar to the one generated by the <!–more–> tag. Beneath the line we just edited, add the following:

    " title="Read the rest of <?php the_title(); ?>" class="more-link">Read the rest of this entry »

    It would also be recommended that you customize the text.

    By default, WordPress will now show the first 55 words of your post. You can change this however, by pasting what you want to be shown into the “Optional Excerpt” box in the Write Post screen. This box understands code, so if you intend upon including images in the excerpt, then you can copy and paste directly from the Code View on the Write Post page.

    Through using this method, you can choose to display different text on the homepage than what is in the article. For instance, you may want to write a summary of the article to come, not merely quote the introduction. Another use is that if you choose to split the excerpt from the post in the middle of a list, you can add the tag to the excerpt, to ensure your homepage continues to validate (Not overly important by any means, but it is nice to do).
    Both of These Methods Will Publish a Partial RSS Feed

    Sadly, WordPress does not natively support the feature of allowing you to continue publishing full-text feeds, when you use either of these methods

    I found this information for you on


  • aecnu
    • WP Unicorn

    Greetings Annabelle,

    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.