Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress custom loop latest first

$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();
 
PREVIOUS NEXT
Tagged: #wordpress #custom #loop #latest
ADD COMMENT
Topic
Name
8+4 =