Wordpress 如何在选项卡中显示分类新闻??我正在使用新闻管理器插件添加新闻?

Wordpress 如何在选项卡中显示分类新闻??我正在使用新闻管理器插件添加新闻?,wordpress,Wordpress,到目前为止,我已经在选项卡中列出了类别。但没有得到该类别下的新闻及其描述。在数据库中,新闻被视为邮报。 我正在使用jquery选项卡显示新闻 我的代码:--- <?php /* Template Name: tabbing */ ?> <?php get_header(); ?> <div id="tab"> <?php //list terms in a given taxonomy (useful as a widget for twent

到目前为止,我已经在选项卡中列出了类别。但没有得到该类别下的新闻及其描述。在数据库中,新闻被视为邮报。 我正在使用jquery选项卡显示新闻

我的代码:---


    <?php
    /* 
    Template Name: tabbing
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="tab">
    <?php
    //list terms in a given taxonomy (useful as a widget for twentyten)
    $taxonomy = 'news-category';
    $tax_terms = get_terms($taxonomy);
    
    ?>
    
    
     <ul class="nav nav-tabs" role="tablist">
       <?php  $counter = 0;   foreach ($tax_terms as $tax_term) { ?>
          <li role="presentation" class="post-<?php  ?> <?=($counter == 1) ? 'active' : ''?>"><a href="#post-<?php ; ?>" aria-controls="home" role="tab" data-toggle="tab"><?php echo $tax_term->name; ?></a></li>
    
       <?php   $counter++; } //exit; ?> 
     </ul>
    
    /* Right all description is displaying but not according to the category... */
        <div class="tab-content">
            <?php
            $counter = 0;
            $loop = new WP_Query( array( 'post_type' => 'news', 'posts_per_page' => -1 ) );
            while ( $loop->have_posts() ) : $loop->the_post(); 
                $counter++;
            ?>
                <div role="tabpanel" class="tab-pane <?=($counter == 1) ? 'active' : ''?>" id="post-<?php the_ID(); ?>"><?php the_content();?></div>
            <?php endwhile; ?>
        </div>
    </div>  
    
    
    <?php get_footer(); ?>