Forums

Expanding first post only (3 posts)

  1. smittenbybritain
    Member
    Posted 2 years ago #

    Hi,

    I'm using a template that shows only post excerpts on the home page.
    I would like to expand just the first post and then leave all others as excerpts. Is there a plug in for this or a hack I can use? I have searched the forum and I'm finding answers that are close to what I need but not exactly.
    You can see my blog here: http://www.smittenbybritain.com

    Thank you!

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    One example:

    <?php
    $count = 0;
    if (have_posts()) {
     while (have_posts()) : the_post();
      $count++;
        if ($count <= 1) {
          the_content();
        } else {
          the_excerpt();
        }
     endwhile;
    }
    ?>

    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    The Loop

  3. Roy
    Member
    Posted 2 years ago #

    I use the Excerpt Editor plugin to do that for me. It has a few more features that I use.

Topic Closed

This topic has been closed to new replies.

About this Topic