从类别中选择帖子时清空数组

I'm trying to get all posts in certain category, but I'm getting empty array. Here is my code:

$posts_args = array(
  'numberposts' => 6,
  'category' => 14,
  'orderby' => 'date',
  'order' => 'DESC',
  'post_type' => 'post'
);
$posts_array = get_posts($posts_args);

echo "<pre>";
print_r($posts_array);
echo "</pre>";

But in admin panel displaying properly.

try this

         $posts_args=array( 
                   'posts_per_page' => 6,
                   'post_type' => 'post',  
                   'order'   => 'DESC',  
                     'tax_query' => array(
                      array(
                          'taxonomy' => 'category',
                          'field'    => 'term_id',
                          'terms'    => array( 14),                           
                         ),
                      )
             );
           $posts_array = get_posts($posts_args);

           echo "<pre>";
           print_r($posts_array);
           echo "</pre>";