Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sort Posts Listing below google maps using custom field
// Sort by custom field. e.g "salary".
add_filter('wpgmp_sorting','wpgmp_sorting_custom_field',1,2);
function wpgmp_sorting_custom_field($sorting,$map) {
$sorting['%salary%__asc__num'] ="Salary Low-High";
$sorting['%salary%__desc__num'] ="Salary High-Low";
return $sorting;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment