如何在wordpress的分类页面顶部显示来自特定标签的帖子

如何在wordpress的分类页面顶部显示来自特定标签的帖子,wordpress,tags,Wordpress,Tags,我想创建一个div,就像一个编辑器选择区域,在每个类别页面的顶部显示贴有标签的编辑器选择。当然,它将只显示来自当前类别页面的帖子。谢谢如果有人感兴趣,以下是代码: <?php if (is_category( )) { // this grabs the current category slug $cat = get_query_var('cat'); $yourcat = get_category ($cat); } // this is the

我想创建一个div,就像一个编辑器选择区域,在每个类别页面的顶部显示贴有标签的编辑器选择。当然,它将只显示来自当前类别页面的帖子。谢谢

如果有人感兴趣,以下是代码:

<?php 
    if (is_category( )) {
    // this grabs the current category slug
    $cat = get_query_var('cat');
    $yourcat = get_category ($cat);
 }

 // this is the query to sort the tag only with the CURRENT CATEGORY by slug

 $args = 'tag=editor-choice&category_name='.$yourcat->slug.'&category_title='.single_cat_title( '', false );

 query_posts( $args );

 // The Loop
 while ( have_posts() ) : the_post();
   echo '<li>';
   the_title();
   echo '</li>';
 endwhile;

 wp_reset_query();

?>

我完全不知道你刚才说了什么。如果你试着解释得更详细些,我相信你会得到你的答案。对不起,我不在了。试着解释一下。。。在每个类别的页面中,我希望显示贴子标签编辑器选项,但不是所有贴子标签编辑器选项,而是仅显示当前类别的贴子