Forums

How to display the full first post and excerpts after that (4 posts)

  1. pixldesigns
    Member
    Posted 1 year ago #

    I know there are several threads dedicated to this, but most that I have tried have not worked. Basically I am trying to get http://billowen.cc to display the first post as a full post. Then all remaining posts as partial posts.

    Is this possible?

  2. stvwlf
    Member
    Posted 1 year ago #

    one way - assume you can fill in the code details

    <?php
    $i = 0;  // initialize counter
    
    { start WP Loop}
    while have_posts()...
       $i++;   // increment counter
      { display title, date, author, category, comments }
    
      if ( $i == 1 ) {
          the_content();
      } else {
          the_excerpt();
      }
    
    endwhile;
    ?>
  3. pixldesigns
    Member
    Posted 1 year ago #

    I'm new to PHP. Where would this go? In my page.php file? Thanks for any help!

  4. stvwlf
    Member
    Posted 1 year ago #

    Since its your posts page, in most themes it would be the theme's index.php file.

    If you are not sure what the WordPress loop is, here is a page about it
    http://codex.wordpress.org/The_Loop

    you can also see the Codes pages about
    the_content http://codex.wordpress.org/Function_Reference/the_content and
    the_excerpt http://codex.wordpress.org/Function_Reference/the_excerpt

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.