• Is there a way to style the first post differentely? For example it could have a larger thumb and the text would go below it while the several older posts would have smaller thumbs aligned by text?

Viewing 2 replies - 1 through 2 (of 2 total)
  • a common method would be to use a counter variable;

    example:

    <?php
    $counter = 1;
    if (have_posts()) :
    while (have_posts()) : the_post();
      if( $counter == 1 ) :
        /*the code to show the first post different*/
        $counter++;
      else :
        /*the code to show the all other posts*/
      endif;
    endwhile;
    endif;
    ?>
    Thread Starter sylwiaofwarsaw

    (@sylwiaofwarsaw)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different styling for the first post’ is closed to new replies.