📜  wordpress 自定义循环 - PHP 代码示例

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

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