At present I have a basic query that outputs 12 custom posts, each in a div.
I need to restructure this to output four divs, each with three of these items inside. So it's sort of like a nested div.
To explain, here is the current HTML output (for 12 items)
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
What I need is something more like this:
<div class="jobsOne">
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
</div>
<div class="jobsTwo">
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
<div class="item">the content comes out here</div>
</div>
Here is my current query:
<?php
query_posts(array(
'post_type' => 'custom_job',
'showposts' => 12
) );
?>
<?php while (have_posts()) : the_post(); ?>
<div class="item job">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p><?php echo get_the_excerpt(); ?></p>
</div>
<?php endwhile;?>
query_posts
. UseWP_Query
to construct your query