‘name’, ‘order’ => ‘ASC’, ‘hierarchical’ => true, ‘hide_empty’ => 0, ‘exclude’ => $st_hp_category_exclude, ‘pad_counts’ => 1 ); $st_categories = get_categories($st_hp_cat_args); $st_categories = wp_list_filter($st_categories,array(‘parent’=>0)); // If there are catgegories if ($st_categories) { foreach($st_categories as $st_category) { $st_cat_counter++; if ((!is_int($st_cat_counter / 2)) && $st_cat_counter != 1) { echo ‘
‘;} elseif ($st_cat_counter == 1) { echo ‘
‘;} echo ‘
‘; echo ‘

(‘ . $st_category->count.’)‘; } echo ‘

‘; // Sub category $st_sub_category = get_category($st_category); $st_subcat_args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘exclude’ => $st_hp_subcategory_exclude, ‘child_of’ => $st_sub_category->cat_ID, ‘pad_counts’ => 1 ); $st_sub_categories = get_categories($st_subcat_args); $st_sub_categories = wp_list_filter($st_sub_categories,array(‘parent’=>$st_sub_category->cat_ID)); // If there are sub categories show them if ($st_sub_categories && (apply_filters( ‘knowhow_get_theme_option’, ‘st_hp_subcat’, null ) == 1)) { foreach($st_sub_categories as $st_sub_category) { ?> $st_cat_post_num, ‘orderby’ => $st_posts_order, ‘meta_key’ => ‘_st_post_views_count’, ‘category__in’ => $st_category->term_id ); } else { $st_cat_post_args = array( ‘numberposts’ => $st_cat_post_num, ‘orderby’ => $st_posts_order, ‘category__in’ => $st_category->term_id ); } $st_cat_posts = get_posts($st_cat_post_args); echo ‘
    ‘; foreach($st_cat_posts as $post) : setup_postdata($post); ?>
  • “>
  • ‘; } echo ‘
‘; } } ?>