Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Last active May 7, 2024 09:27
Show Gist options
  • Save propertyhive/94adb0b133a154b86fb0d10decf3ca90 to your computer and use it in GitHub Desktop.
Save propertyhive/94adb0b133a154b86fb0d10decf3ca90 to your computer and use it in GitHub Desktop.
add_action( 'elementor/query/investmentquery', 'elementor_query_investment_only' );
function elementor_query_investment_only( $query )
{
PH()->query->property_query( $query );
// Set the custom post type
$query->set( 'post_type', [ 'property' ] );
$tax_query = $query->get('tax_query');
$new_tax_query = $tax_query;
$new_tax_query[] = array(
'taxonomy' => 'property_type',
'terms' => array(79),
'operator' => 'IN',
);
$query->set( 'tax_query', $new_tax_query );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment