<?php $total_query = $wpdb->num_rows;
if (isset($query) && !empty($query)) {
	foreach ($query as $user) {
		$user = (isset($user->ID)?$user->ID:$user);
		echo ask_author($user,$user_sort);
	}
}else {
	$no_user = true;
}

if (isset($total_users) && $total_users > $total_query) {
	$current_page = max(1,$paged);
	echo '<div class="pagination">'
		.paginate_links(array(
			'base' => (is_page_template("template-search.php")?add_query_arg('paged','%#%'):add_query_arg('page','%#%')),
			'format'    => (is_page_template("template-search.php")?'':'page/%#%/'),
			'current' => $current_page,
			'total' => $total_pages,
			'prev_text' => '<i class="fa fa-angle-left"></i>',
			'next_text' => '<i class="fa fa-angle-right"></i>',
		)).
	'</div><div class="clearfix"></div>';
}

if (isset($no_user) && $no_user == true) {
	include( get_template_directory() . '/includes/search-none.php' );
}