Created
January 27, 2026 20:31
-
-
Save propertyhive/0fefea73fbccc83018ecdaba19ae45f2 to your computer and use it in GitHub Desktop.
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
| // Adds a Query ID 'soldpropertyquery' that can be used in Loop Grid widget | |
| add_action( 'elementor/query/soldpropertyquery', 'elementor_query_sold_only' ); | |
| function elementor_query_sold_only( $query ) { | |
| // Ensure we only query the 'properties' custom post type | |
| $query->set( 'post_type', 'property' ); | |
| // Add tax query for Availability = Sold | |
| $tax_query = array( | |
| array( | |
| 'taxonomy' => 'availability', | |
| 'field' => 'slug', | |
| 'terms' => 'sold', | |
| ), | |
| ); | |
| $query->set( 'tax_query', $tax_query ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment