📜  wordpress 自定义循环最新优先 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:23.396000             🧑  作者: Mango

代码示例1
$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();