<?php

$args = array(
    	'class'=>'',
    	'icon_class'=>'',
		'image'=>'',
		'title'=>'',
		'title2'=>'',
		'tag'=>'5',	
		'margin'=>'',
		'link_url'=>'',
		'link_target'=>'',	
);

$html = "";

extract(shortcode_atts($args, $atts));

	if(is_numeric($image)) {
		$bauen_image = wp_get_attachment_url( $image );
		$bauen_title = get_the_title( $image );
	} else {
		$bauen_image = $image;
		$bauen_title = $image;
	}

	$html .='<div class="sec-services services '.esc_attr($class).'"';
			if($margin != '') { $html .='style="margin:'.$margin.';"';} 
	$html .='>';	
		$html .='<div class="item">';
			if($link_url != '') {	
				$html .='<a href="'.esc_url($link_url).'"';
					if($link_target != '') { $html .='target="'.esc_attr($link_target).'"';}						
				$html .='>';
			}	
				if(is_numeric($image)) {
					$html .='<img src="'.esc_url($bauen_image).'" alt="'.esc_attr($bauen_title).'" />';
				} else {
					if($icon_class != '') {	
						$html .='<i class="'.esc_attr($icon_class).'"></i>';  
					}
				}
				if($title != '') {	
					$html .='<h'.esc_attr($tag).'>'.esc_html($title).'</h'.esc_attr($tag).'>';					
				}
				$html .='<div class="line"></div>';
				if($content != '') {	
					$html .=''.do_shortcode($content).'';  
				} 						
				if($title2 != '') {	
				$html .='<div class="numb">'.esc_html($title2).'</div>';
				}
				
			if($link_url != '') {
				$html .='</a>';
			}
		$html .='</div>';		
	$html .= '</div>';			

echo $html;