📅  最后修改于: 2022-03-11 14:54:23.396000             🧑  作者: Mango
$args = array(
'post_type' => $post,
'post_status' => 'publish',
'posts_per_page' => $post_total,
'orderby' => 'publish_date',
'order' => 'DESC'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ): $loop->the_post();
// Your code
endwhile;
wp_reset_postdata();