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]
One loop with conditional coding for the first post.
Chris Lowry
Member
Posted 8 months ago #
thanks, yeh I realised I was being an idiot!
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.