wordpress sorting using array merge by price in ascending order but price with 0 must be show last
hope this will usefull to some one. <?php /* ADDED by for sorting ASCENDING order but call for price (ie price with 0) last */ function my_sort_custom( $orderby, $query ){ global $wpdb; $orderby = ” case when CAST(meta_value AS SIGNED) = ‘0’ then 1 else 0 end ,CAST(meta_value AS SIGNED) “; return $orderby; } add_filter(‘posts_orderby’,’my_sort_custom’,10,2); … Read more