From 55833668704e87f34ef1ee4641a508ba5ff4d854 Mon Sep 17 00:00:00 2001 From: Fellan-91 Date: Thu, 16 May 2024 13:05:19 +0300 Subject: [PATCH] fixed default sort for images --- classes/class-get-portfolio.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/class-get-portfolio.php b/classes/class-get-portfolio.php index 00bb8c59..fe22390c 100644 --- a/classes/class-get-portfolio.php +++ b/classes/class-get-portfolio.php @@ -1449,12 +1449,16 @@ public static function get_query_params( $options, $for_filter = false, $layout_ } } - if ( 'desc' === $custom_order_direction ) { - $images = array_reverse( $images ); - } - break; } + + if ( + 'desc' === $custom_order_direction && + 'rand' === $custom_order && + 'default' === $custom_order + ) { + $images = array_reverse( $images ); + } } // pages count.