• Hi all,

    I have an issue where first three posts need to be displayed as different style to other main ones.

    I know we need to use while post method but if you do this you get the same style as a loop. I’m guessing you might have to use some offset features for loop to start from 2 then individually set array rows to pull first three data.

    My blog is

    http://favstay.com/wordpress/

    Please have a look.

    If you can please let me know the best solutions for this, it would be greatly appreciated.

    Thank you very much.

    Jae

Viewing 1 replies (of 1 total)
  • You can use a counter in the loop to assign a different class to the posts. Code something like this:

    <div class='firstposts'>
    <?php while (have_posts()): the_post();
       if (++$post_count == 4)
          echo "</div><div class='otherposts'>";
       // rest of loop code
    endwhile;
    echo '</div>';
Viewing 1 replies (of 1 total)
  • The topic ‘Different styles for while post tags’ is closed to new replies.