valiable = $args;
if ( $this->valiable == 'main' ) {
$this->main_category();
} else if ( $this->valiable == 'sub' ) {
$this->sub_category();
}
}
/**
* main category
*/
private function main_category() {
$args = array(
'orderby' => 'name',
'parent' => 0,
'pad_counts' => 1
);
echo '
';
$categories = get_categories( $args );
foreach ( $categories as $category ) {
if ( $this->count_main ) $this->count_main = $this->str . $category->count . $this->end;
echo '
' . $category->name . $this->count_main . '';
}
echo '
';
}
/**
* sub category
*/
private function sub_category() {
$args = array(
'parent' => get_query_var('cat'),
'pad_counts' => 1
);
$categories = get_categories( $args );
$is_category = get_queried_object();
if (is_object($is_category)) {
$is_flg = $is_category->taxonomy;
/**
* breadcrumbs
*/
if ($is_flg === 'category') {
echo '