• Resolved Accordo

    (@accordo)


    Hi to everyone!
    I’m trying to find a fix to display, only for the first post listed, the_content(); or the_meta(); instead of the default that is set for the other posts: the_excerpt();

    Anyone knows some wordaround to create an “if” only for first post?

    Many thanks coders!

Viewing 2 replies - 1 through 2 (of 2 total)
  • An example loop:

    First post display content and meta, just excerpts for the rest

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

    Thread Starter Accordo

    (@accordo)

    Great work! Thank you very much Michael.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display content/meta only for first post’ is closed to new replies.