Multiple loops for custom post type to spread data across rows
How do I split the values within a custom post type loop so that the title is in the first loop which outputs in the first DIV and the content is in the second loop outputting in the second DIV? Two loops may not be the best way to do, I don't know. Somebody mentioned to me about using one loop then storing each item in a string and then splitting the string. I have no idea how to do this either.
I also need a new row to begin once the number of posts reach 5.
Here's my PHP loop...
$custom_query = new WP_Query( $custom_args );
query_posts(array(
'post_type' = array('team')
) );
if ( $custom_query-have_posts() ) :
/* Start my loop */
while ( $custom_query-have_posts() ) : $custom_query-the_post();
echo "div". the_title(); . "/div";
echo "div". the_content(); . "/div";
endwhile;
endif;
The HTML output i'm looking for as follows...
div class"row"
div class="title chris"/div
div class="title darren"/div
div class="title ryan"/div
div class="title john"/div
div class="title emma"/div
div class="content chris"/div
div class="content darren"/div
div class="content ryan"/div
div class="content john"/div
div class="content emma"/div
/div
div class"row"
div class="title steve"/div
div class="title ed"/div
div class="title steph"/div
div class="title neil"/div
div class="title claire"/div
div class="content steve"/div
div class="content ed"/div
div class="content steph"/div
div class="content neil"/div
div class="content claire"/div
/div
div class"row"
div class="title tarnea"/div
div class="title carl"/div
div class="title kim"/div
div class="title jade"/div
div class="title lee"/div
div class="content tarnea"/div
div class="content carl"/div
div class="content kim"/div
div class="content jade"/div
div class="content lee"/div
/div
Topic split loop custom-post-types Wordpress
Category Web