I've got to display 6 boxes on the homepage of a site I'm working on and struggling with the code. I've managed to get this far:
<?php
$term = get_term( hotelCategoryID, 'accommodation-category' );
$output = '<div class="box"> ';
if (function_exists('get_terms_meta'))
{
$category_hotel = get_terms_meta(hotelCategoryID, 'image_taxonomy',true);
}
if($category_hotel ) :
$output .= '<img src="'.$category_hotel.'" width="300" alt="'.$term->name.'" />';
endif;
$output .= '<div class="textbox">
<em class="corner">corner</em>
<h2>'.$term->name.'</h2>'.
$term->description.'
</div>';?>
<?php
$args = array('post_type' => 'accommodation','tax_query' => array( array('taxonomy' => 'accommodation-category','field' => 'id','terms' => hotelCategoryID)));
query_posts($args);?>
<?php if (have_posts()) : $count_post = 0;
$output .= '<div class="list-area"><ul>';
while (have_posts()) : the_post();
if($count_post==5) $output .='</ul><ul class="list">';
$count_post++;
$output .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
endwhile;
$output .= '</ul>
<div class="opener-holder">
<a class="opener" href="#"><span>+ MORE '.$term->name.'</span><em>- LESS '.$term->name.'</em></a>
</div>
</div>';
endif; wp_reset_query();
$output .= '</div>';?>
But when I copy the code and modify it to get the information from another custom post type it just displays one block on the homepage, I assume it's an issue with the loop in this code. I've tried various other codes but this is the one that I need as it has "5" highlighted posts, and then the rest aren't.
Could someone give me an idea on how to edit the loop so I can display 6 of these on one page please?
Thanks!