<?php
/**
 * Shortcode Title: Icon
 * Shortcode: counter
 * Usage: [counter title="Your title" counter="123" icon="fa-search" icon_upload="" icon_color="#3G3G3G" counter_color="" title_color="#FFF"]

 */
add_shortcode('counter', 'ts_counter_func');

function ts_counter_func( $atts, $content = null ) {

	extract(shortcode_atts(array(
		'title' => '',
		'counter' => '0',
		'icon' => '',
		'icon_upload' => '',
		'icon_color' => '',
		'counter_color' => '',
		'text_color' => ''
	),
	$atts));

	if (!empty($icon_upload)) {
		$icon_html = '<img src="'.$icon_upload.'" alt="'.esc_attr($title).'" />';
	} else {
		$icon_html = '<i class="icon '.$icon.'"></i>';
	}
	
	$html = '
		<div class="sc-counter-2">
			<span class="sc-counter-icon">'.$icon_html.'</span>
			<span class="sc-quantity" data-quantity="'.$counter.'">0</span>
			<span class="sc-title">'.$title.'</span>
		</div>';
	return $html;

}