'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; foreach ($categories as $category) { $tag = $category->term_id; $tag_extra_fields = get_option(BETUBE_CATEGORY_FIELDS); if (isset($tag_extra_fields[$tag])) { $beeCatThumb = $tag_extra_fields[$tag]['your_image_url']; } $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; } ?>
<?php echo get_cat_name( $catName ); ?>