Created
April 8, 2025 13:22
-
-
Save propertyhive/61fdc54c9a1e653e2edb2a63dfa3c83a 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
add_action( 'elementor/query/simons_on_market_properties', 'elementor_simons_on_market_properties' ); | |
public function elementor_simons_on_market_properties( $query ) | |
{ | |
// maintain order set in Loop Carousel options | |
$original_orderby = $query->get( 'orderby' ); | |
$original_order = $query->get( 'order' ); | |
PH()->query->property_query( $query ); // this will filter on_market | |
// Set the custom post type | |
$query->set( 'post_type', [ 'property' ] ); | |
// restore order set in Loop Carousel options | |
$query->set( 'orderby', $original_orderby ); | |
$query->set( 'order', $original_order ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment