function az_get_the_terms($taxonomy='category',$link=TRUE ,$html_tag='span',$pid=NULL){

	$html='';
	if($pid=NULL) $pid=get_the_ID();
	$terms = get_the_terms($pid, $taxonomy );
	if($terms){
		if($link):
			foreach ($terms as $term) {
	 			$html .= '<a href="'.get_term_link($term ->term_id, $taxonomy ).'" class="btn-term term-'.$term ->term_id.'">'.$term -> name.'</a>';
			}
		else:
			foreach ($terms as $term) {
	 			$html .= '<'.$html_tag.' class="term term-'.$term ->term_id.'">'.$term -> name.'</'.$html_tag.'>';
			}	
		endif;
			
		return $html;
	}else{
		return NULL;
	}

}
function az_get_the_1stterm($taxonomy='category',$link=TRUE ,$html_tag='span',$pid=NULL){
	$html='';
	if($pid=NULL) $pid=get_the_ID();
	$terms = get_the_terms($pid, $taxonomy );
	if($terms){
		if($link):
			foreach ($terms as $term) {
	 			$html .= '<a href="'.get_term_link($term ->term_id, $taxonomy ).'" class="btn-term term-'.$term ->term_id.'">'.$term -> name.'</a>';
				break;
			}
		else:
			foreach ($terms as $term) {
	 			$html .= '<'.$html_tag.' class="term-'.$term ->term_id.'">'.$term -> name.'</'.$html_tag.'>';
				break;
			}	
		endif;
			
		return $html;
	}else{
		return NULL;
	}
}