About to implement my first Wordpress site. My understanding is that it helps if my loop is calling a generic item, for example:
<div id="article-excerpt">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
When using Twitter Bootstrap or 960.gs, my feed spans multiple columns and multiple rows.
For example, the articles are laid out horizontally across a nested grid comprised of 5 columns. Every 5 items, there's a new row.
Row 1: [article div] [article div] [article div] [article div] [article div]
Row 1: [article div] [article div] [article div] [article div] [article div]
Row 1: [article div] [article div] [article div] [article div] [article div]
etc.
I'll explain the next bit to check that I have a fundamental understanding of how these systems work.
In 960.gs, for nested grids, I need to declare the first item and last item in each row with classes of alpha
and omega
respectively:
<div id="article excerpt" class="alpha grid_1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
Likewise, in Twitter Bootstrap I need to place each row in its own special DIV:
<div class="row">
<div id="article-excerpt" class="span1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
<div id="article-excerpt" class="span1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
<div id="article-excerpt" class="span1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
<div id="article-excerpt" class="span1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
<div id="article-excerpt" class="span1">
<div>Article Heading</div>
<div>Article Sub-heading</div>
</div>
</div>
If my grid isn't nested, things are a little simpler. I realise I can simply place a span1
or grid_1
inside my container. Each row will auto-wrap to the next line when it gets to the maximum number of columns.
With this in mind, my Wordpress loop would be very simple. It wouldn't need to identify first and last items per row, or count, or increment numbers, or anything like that.
What I want to find out is if there's a way to simplify my approach so that the loop doesn't necessarily have to count items, kind of like this:
<div class="grid_5">
<LOOP> <div class="grid_1">generic article</div> </LOOP>
</div>