如何循环显示自定义分类法的子项?

How to display child of custom taxonomy in a loop?

我已经为帖子、主题创建了一个分类法

add_action( 'init', 'create_cw_hierarchical_taxonomy', 0 );
//create a custom taxonomy name
function create_cw_hierarchical_taxonomy() {
$labels = array(
'name' => _x( 'Topics', 'taxonomy general name' ),
'singular_name' => _x( 'Topic', 'taxonomy singular name' ),
'search_items' => __( 'Search Topics' ),
'all_items' => __( 'All Topics' ),
'parent_item' => __( 'Parent Topic' ),
'parent_item_colon' => __( 'Parent Topic:' ),
'edit_item' => __( 'Edit Topic' ),
'update_item' => __( 'Update Topic' ),
'add_new_item' => __( 'Add New Topic' ),
'new_item_name' => __( 'New Topic Name' ),
'menu_name' => __( 'Topics' ),
);
// taxonomy register
register_taxonomy('topics',array('post'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'topic' ),
));
}

现在我在后台创建了两个主题,主题1和主题2

我想在不同的循环中显示两个主题,所以我写了以下代码

<?php
            $options = array(
                'post_type' => 'post',
                'posts_per_page' => 1,
                'orderby' => 'date',
                'order' => 'ASC',
                'paged' => $paged,
                'tax_query' => array(
                    array(
                        'taxonomy' => 'topics',
                        'field' => 'name',
                        'terms' => 'topic-1'
                    )
                )
            ); ?>
            
            <?php $query = new WP_Query( $options );
            if ( $query->have_posts() ) :
                while($query->have_posts()) : $query->the_post();?> 

            <div class="col-sm-8">
                <div class="featured-post-large m-m-b-1">
                    <div class="featured-post-large-control text-light">
                        <div class="featured-post-large-content mx-5">
                            <div><?php the_category( $separator, $parents, $post_id ); ?></div>
                            <h2><a href="<?php echo get_permalink($post->ID) ?>" class="archive-title"><?php the_title()?></a></h2>
                            <div class="py-2"><?php the_excerpt()?></div>
                        </div>
                    </div>
                </div>
            </div>
            
            <?php endwhile; wp_reset_query();
            endif; ?>

我无法获取主题 1 和主题 2 下的帖子,请指导我。谢谢!

$options = array(
                'post_type' => 'post',
                'posts_per_page' => 1,
                'orderby' => 'date',
                'order' => 'ASC',
                'paged' => $paged,
                'tax_query' => array(
                    array(
                        'taxonomy' => 'topics',
                        'field' => 'slug',
                        'terms' => 'topic-1'
                    )
                )
            );