Title: WordPress query / filter
Last modified: April 6, 2023

---

# WordPress query / filter

 *  [Trident Marketing Anglia Ltd](https://wordpress.org/support/users/tridentmarketing/)
 * (@tridentmarketing)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-query-filter/)
 * Hey,
   I’m using a plugin at the moment, but I’m changing the pages via elementor
   pro templates and so I need to make some queries.
 * The plugin I’m using currently has a query which seems to be activated via apply_filters(‘
   propertyhive_show_results’,true);
   however I can’t seem to find the code which
   generates the query.
 * According to elementor pro, I should be able to enter the name of query in the
   loop grid, and it will only display results from that query. Does anyone have
   any knowledge of this?
   I’ve tried entering the query id as “propertyhive_show_results”
   but it doesn’t show the correct results.
 * Any ideas how I can query these posts?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-query-filter/#post-16633190)
 * ” I’m changing the pages via elementor pro templates “
 * You’re using a commercial/premium plugin, so please use their official support
   channel. We feel they are best equipped to support their products.
 * [https://elementor.com/support/](https://elementor.com/support/)
 * **Commercial products are not supported in these forums:** [https://make.wordpress.org/support/trouble/section-1-getting-started/what-is-not-supported](https://make.wordpress.org/support/trouble/section-1-getting-started/what-is-not-supported)
 *  Thread Starter [Trident Marketing Anglia Ltd](https://wordpress.org/support/users/tridentmarketing/)
 * (@tridentmarketing)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-query-filter/#post-16633242)
 * Ah ok, thank you for pointing me to them, I guess I’ve asked the wrong question–
   I’m trying to understand how the WP Query works – I’ve just written this
 *     ```wp-block-code
       function featured_property_function( $query ) {
   
       	// Get current meta Query
       	$meta_query = $query->get( 'meta_query' );
   
       	// If there is no meta query when this filter runs, it should be initialized as an empty array.
       	if ( ! $meta_query ) {
       		$meta_query = [];
       	}
   
       	// Append our meta query
       	$meta_query[] = array([
       		array(
       		'key' => '_featured',
       		'value' => [ 'yes' ],
       		'compare' => 'in',
       			),
       		array(
       		'key' => '_on_market',
       		'value' => [ 'yes' ],
       		'compare' => 'in',
       			),
       		]);
   
       	$query->set( 'meta_query', $meta_query );
   
       }
       add_action( 'elementor/query/featured_filter', 'featured_property_function' );
       ```
   
 * And Its worked – so I’m trying to work out how I can make a query that takes 
   a url for a search query – such as ‘?minimum_rent=&maximum_rent=&minimum_bedrooms
   =0&maximum_bedrooms=5&furnished=&department=residential-lettings’ and then lets
   me query my posts using the information in that url.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress query / filter’ is closed to new replies.

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Trident Marketing Anglia Ltd](https://wordpress.org/support/users/tridentmarketing/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-query-filter/#post-16633242)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
