WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] All posts excerpt except the first (3 posts)

  1. vinuel
    Member
    Posted 4 years ago #

    Hi there,
    I’ve searched the forum but I couldn’t find a solution for this:
    On my front page I want a list of my latest posts and it shall be shown as excerpt ( the_excerpt(); ). Only the first article shall be shown in whole ( the_content(); ). Isn’t there an easy if/else-way to realize this?
    I’ve found something like this:

    if (is_post()) {
    global $more;
    $more = 1;
    the_content();
    } else the_excerpt();

    but it just show me one article as excerpt.

  2. MichaelH
    Member
    Posted 4 years ago #

    Didn't test this but something similar to:

    <?php
    if (have_posts()) {
      $count = 0;
      while (have_posts()) : the_post(); ?>
        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
        <?php
        $count++;
        if ($count <= 1) {
          the_content(); // display the full content of the first two posts only
        } else {
          the_excerpt;
        } // if ($count
      } // while (have_posts
    } // if (have_poss
    ?>

    Also see http://www.google.com/search?q=wordpress+full+content+first+post+excerpt+for+rest

  3. vinuel
    Member
    Posted 4 years ago #

    Thanks Michael!

    The code doesn’t work for me, but this Plug-In is exactly what I was looking for: http://www.dailyblogtips.com/homepage-excerpts-wordpress-plugin/

Topic Closed

This topic has been closed to new replies.

About this Topic