Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save propertyhive/61fdc54c9a1e653e2edb2a63dfa3c83a to your computer and use it in GitHub Desktop.
Save propertyhive/61fdc54c9a1e653e2edb2a63dfa3c83a to your computer and use it in GitHub Desktop.
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