<?php
/**
 * @version	$Id$
 * @package	IT_Theme_Framework
 * @author	 InnoThemes Team <support@innothemes.com>
 * @copyright  Copyright (C) 2012 InnoThemes.com. All Rights Reserved.
 * @license	GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.innothemes.com
 */

$loop = new WP_query(
	array(
		'post_type'      => 'customer',
		'posts_per_page' => -1,
		'orderby'        => 'ASC'
	)
);

$count       = 0;
$arr_content = array();
while( $loop->have_posts() ) :
	$loop->the_post();
$count++;

$url 	= get_post_meta( $post->ID, "url", true );
$urlimg	= get_post_meta( $post->ID, 'urlimg', true );
$str 	= '';

if( $url != '' ) {
	$str .= '<li><a href="' . $urlimg . '"><img src="' . $url . '" />';
	$str .= '</a>';
	$str .= '</li>';
} else {
	$str .= '<li><a href="' . $urlimg . '">';
	$str .= get_the_post_thumbnail( $page->ID, 'thumbnail' );
	$str .= '</a>';
	$str .= '</p></li>';
}
$arr_content[] = $str;

endwhile;  wp_reset_query();
if( $count ): ?>

<h3 class="it-title"><?php _e( 'Our Customer', IT_THMFW_TEXTDOMAIN ); ?></h3>
<div class="it-separate"></div>
<ul class="it-customer-logo">
	<?php echo implode( "", $arr_content ); ?>
</ul><!--End ul.it-customer-logo-->

<?php endif; ?>