Forums

2 loops needed for very different styling? (4 posts)

  1. Chris Lowry
    Member
    Posted 8 months ago #

    Hey,

    I'm building a front page that looks like this image: http://postimage.org/image/566fcqkk/

    As you can see, there are distinct styling differences between the first and subsequent posts.

    What is the best way to do this? Two loops, or just use one loop with a lot of conditional coding for the first div?

    Bless,
    [sig moderated as per the Forum Rules]

  2. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    One loop with conditional coding for the first post.

  3. Chris Lowry
    Member
    Posted 8 months ago #

    thanks, yeh I realised I was being an idiot!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Nope - it was a reasonable question to ask. Sometimes there's very little to lose/gain between the 2 approaches. But, in theory, if this is just a matter of styling, all you need to do is add an extra class to the first post and do the rest via CSS - which means one less db query compared to the 2 loops approach.

Reply

You must log in to post.

About this Topic