Last active
March 17, 2025 20:04
-
-
Save g-maclean/5d6ee5792c453d1bcb4dbd4642ec336a to your computer and use it in GitHub Desktop.
PropertyHive - Elementor order by availability change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//NOT for main search page, but for standalone loop grids | |
//use orderbyavailabilitychange in the queryID field | |
function custom_elementor_loop_order_availability_change($query) { | |
$query->set('meta_key', '_availability_change_date'); | |
$query->set('orderby', 'meta_value'); | |
$query->set('order', 'DESC'); | |
} | |
add_action('elementor/query/orderbyavailabilitychange', 'custom_elementor_loop_order_availability_change'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment