<section class="adsCategoryslide">
	<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'];		
	?>
		<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 catSlide">
		<div class="customNav">            
			<a class="prev left"><i class="fa <?php if(is_rtl()){ echo "fa-angle-right";}else{ echo "fa-angle-left"; } ?>"></i></a>             
			<a class="next right"><i class="fa <?php if(is_rtl()){ echo "fa-angle-left";}else{ echo "fa-angle-right"; } ?>"></i></a>
        </div>
		<div class="shadow-img">
            <img src="<?php echo get_template_directory_uri(); ?>/images/catshadow.png" alt="shadow">
        </div>
		<div class="owl-carousel-category">
		<?php 
		$argsmaino = array(	
			'order' => 'DESC',
			'hide_empty'               => false,
			'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'               => false,						
					'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="item-cat">
				<a href="<?php echo get_category_link( $catName ); ?> ">
					<span class="circle" style="border-color:<?php echo $caticoncolor; ?>;"><i class="<?php echo $category_icon_code; ?> fa-2x" style="color:<?php echo $caticoncolor; ?>;"></i></span>
					<span class="head"><?php echo get_cat_name( $catName ); ?></span>
				</a>
			</div>
		<?php } /*End For Each */ ?>	
		</div>
	</div><!--End Row catSlide-->
	<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 Section adsCategoryslide -->