My random sorting of custom posts isn't working since I upgraded to WordPress 5.4. This is the query that I am using:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'client', 'post_status' => 'publish', 'posts_per_page' => '7', // you may edit this number 'paged' => $paged, 'orderby' => 'rand', 'meta_query' => array ( array ('key' => 'wpcf-featured-post', 'value' => '1', 'compare' => '=')) ); $client_items = null; $client_items = new WP_Query($args);
Has something changed in 5.4 to sort posts randomly?