Search
 
SCRIPT & CODE EXAMPLE
 

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();
Comment

PREVIOUS NEXT
Code Example
Php :: php get user ip address 
Php :: the configuration file now needs a secret passphrase (blowfish_secret) 
Php :: migrate symfony command 
Php :: php get location of user 
Php :: Your Composer dependencies require a PHP version "= 7.3.0" 
Php :: get_declared_classes 
Php :: wordpress get post time 
Php :: carbon parse subday 
Php :: wp get term link 
Php :: laravel debugbar false not working 
Php :: php nested array contains 
Php :: laravel migration remove unique constraint 
Php :: echo first 100 prime numbers php 
Php :: laravel change column type 
Php :: php regex validate username 
Php :: php get browser 
Php :: header location php 
Php :: carbon parse from format 
Php :: laravel sum group by 
Php :: In php, how to convert string value into an int 
Php :: phpstan ignore 
Php :: pakistan time zone 
Php :: deprcation problem phpmyadmin ubuntu 
Php :: php add year to date 
Php :: include a website in php file 
Php :: php append file 
Php :: install phpunit on ubuntu 18.04 
Php :: share link in twitter php 
Php :: symfony call another controller 
Php :: login with email or phone number laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =