'category', 'hide_empty' => false, // 全部展示,含 0 篇文章的分类 'orderby' => 'menu_order name', 'order' => 'ASC', ]); if (is_wp_error($all_terms)) { $all_terms = []; } $top_level = []; $children_by_parent = []; foreach ($all_terms as $term) { if ((int) $term->parent === 0) { $top_level[] = $term; } else { $children_by_parent[(int) $term->parent][] = $term; } } $total_cats = count($all_terms); $total_counts = wp_count_posts(); $total_posts = $total_counts && isset($total_counts->publish) ? (int) $total_counts->publish : 0; $page_title = trim((string) get_the_title()); if ($page_title === '') { $page_title = __('分类目录', 'aksrt'); } ?> 'site-main container ', 'has_sidebar' => false, 'page_kind' => 'categories', ]); } ?>
esc_html($page_title), 'desc' => $cats_meta, ]); ?>
term_id; $cat_link = get_category_link($cat_id); $cover_url = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_category_cover_url($cat_id) : (get_template_directory_uri() . '/assets/img/placeholder.svg'); $desc = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_category_recommend_desc($cat_id) : (string) $cat->description; $children = $children_by_parent[$cat_id] ?? []; ?>

false]); } get_footer();