<!-- Start our categories -->
<section class="adsCategoryV2">
	<div class="row">
	<?php 
		global $redux_demo;
		$allCatURL = $redux_demo['all-cat-page-link'];
		$trnsCatVAll = $redux_demo['trns-cat-viewall-btn'];
		$catSecTitle = $redux_demo['cat-sec-title'];
		$catSecDesc = $redux_demo['cat-sec-desc'];
		$category_icon_code = "";
		$category_icon_color = "";
		$your_image_url = "";
		$caticoncolor="";
		$category_icon="";
	?>
		<div class="mainHeading">
			<div class="large-6 medium-8 large-centered medium-centered columns">
				<h4><?php echo $catSecTitle; ?></h4>
				<p><?php echo $catSecDesc; ?></p>
			</div><!--End large-5 -->
		</div><!--End mainHeading -->
	</div><!--End Row -->
	<div class="row catBox1">
	<?php 
		$argsmaino = array(	
			'order' => 'DESC',
			'hide_empty'               => 1,
			'number'                   => '8',
			'taxonomy'                 => 'category',
			'pad_counts'               => false
			); 
		$categories = get_categories($argsmaino);
		$currentCat = 0;
		foreach ($categories as $category) {
				if ($category->category_parent == 0) {
					$currentCat++;
				}
			}
		$argsmain = array(
					'order'                    => 'DESC',
					'hide_empty'               => 1,						
					'number'                   => '8',
					'taxonomy'                 => 'category',
					'pad_counts'               => false 
				);
		$cat_counter = $redux_demo['home-cat-counter'];
		$categories = get_terms(
				'category', 
				array('hide_empty' => 0,'parent' => 0,'number' => $cat_counter,'order'=> 'ASC')	
					);
		$current = -1;
		//print_r($categories);	exit();
		foreach ($categories as $category) {
			$tag = $category->term_id;
			$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
			if (isset($tag_extra_fields[$tag])) {
				$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
				$caticoncolor = $tag_extra_fields[$tag]['category_icon_color'];	
			}
			$cat = $category->count;
			$catName = $category->term_id;
			$mainID = $catName;
			$current++;
			$allPosts = 0;
			$categories = get_categories('child_of='.$catName);
			foreach ($categories as $category) {
				$allPosts += $category->category_count;
			}
		?>
		<div class="large-3 medium-6 columns end">
            <div class="categoryBox">
                <div class="catHead">
                    <span style="border-color:<?php echo $caticoncolor; ?>;"><i style="color:<?php echo $caticoncolor; ?>;" class="<?php echo $category_icon_code; ?>"></i></span>
                    <h4><a href="<?php echo get_category_link( $catName ); ?>"><?php echo get_cat_name( $catName ); ?></a></h4>
                </div>
                <div class="catDesc">
					<?php $desc = category_description( $catName ); ?>
					<?php //echo substr( category_description( $catName ),0,70 ); ?>
					<p><?php echo wp_trim_words( $desc, 10, '...' );?></p>
                </div>
            </div>
        </div>
		<?php } /*End For Each */ ?>
	</div><!--End Row -->
	<div class="row">
		<div class="view-all text-center">
			<a href="<?php echo $allCatURL; ?>" class="button radius"><?php echo $trnsCatVAll; ?></a>
		</div>
	</div>
</section>	
<!-- End our categories -->