这个get_the_category() 函数从循环中检索分配给第一篇文章的类别,这不是您的意思。我想audit, income, tax, 等是内置类别,而不是自定义分类法(在这种情况下,需要替换cat 的参数WP_Query 到tax_query). 
创造category.php 如果文件不存在,请通过复制archive.php. 这样,模板将仅在类别页面上使用。
的IDcurrently viewed 您可以使用的类别get_queried_object_id(). 您不必在category.php 文件,它将始终是正确的。有了类别ID,就可以将它们插入查询参数中,并且只接收属于它的帖子。
如果您打算仅将模板应用于选定类别(审计、收入、税务),而不是全部,请使用{$type}_template 滤器
//
// ge ID of the  current category
$cat_id = get_queried_object_id();
//
// get \'news\' posts from current category 
$args = array(
    \'post_type\' => \'news\',
    \'posts_per_page\' => 10,
    \'cat\'       => (int)$cat_id,  // <==
    //\'meta_query\' => array(
    //    array(
    //        \'key\' => \'recommended_article\',
    //        \'value\' => \'1\',
    //        \'compare\' => \'=\',    // <== 
    //    )
    )
);
$query = new WP_Query( $args );
//
// display posts
// 
wp_reset_postdata();
//
// get \'articles\' posts from current category 
$args = array(
    \'post_type\' => \'articles\',   // <==
    \'posts_per_page\' => 10,
    \'cat\'       => (int)$cat_id,
    //\'meta_query\' => array(
    //    array(
    //        \'key\' => \'recommended_article\',
    //        \'value\' => \'1\',
    //        \'compare\' => \'=\',
    //    )
    )
);
$query = new WP_Query( $args );
//
// ...
// 
wp_reset_postdata();