if(have_posts()) :
while ( have_posts() ) : the_post(); $x++;
$ident=get_the_id(); $image = wp_get_attachment_image_src( get_post_thumbnail_id( $ident ), 'full' );
$category_detail=get_the_terms($ident,'horizonte_sectores');
foreach($category_detail as $cd){
$cattxt='horiz_'.$cd->term_id;
$catname=$cd->name;
} $salida.='
'; endwhile; echo $salida;
else:
?>
endif;
?>