How to list two specific stores at first and sort the rest alphabetically?
-
I already put this code inside my functions.php and changed stores to city which sorty my stores alphabetically by city, but I want 2 specific stores to be listed first. How to do this?
This is a basic example how it would work, but I don’t know how to use this inside my custom_result_sort function
$stores = array("A", "B", "C", "D"); usort($stores, function($a, $b) { if ($b == "C") { return 1; } });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to list two specific stores at first and sort the rest alphabetically?’ is closed to new replies.