根据上一篇文章《WordPress 文章状态值分别有哪些?》可以获知 WordPress 回收站的文章状态值是 trash,假如我们只输出 post 类型的回收站文章链接地址的示例:
- <?php
- $args = array(
- ‘post_status’ =>’trash’,
- ‘post_type’ =>’post’,
- ‘showposts’ => 200,
- );
- query_posts( $args );
- if ( have_posts() ) :
- while ( have_posts() ) : the_post(); ?>
- <?php the_permalink(); ?><br/>
- <?php endwhile;endif;?>
其中 ‘showposts’ => 200 就是输出 200 条记录,小于 200 条记录就输出所有记录。