WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / Technical: Add a new filter to Property Directory List

Technical: Add a new filter to Property Directory List

3841 views 0
First of all, you need to add the new field in the sidebar list  – you do that in wpresidence/templates/directory_filters.php 
The actual search is made via Ajax
The js events are in wpresidence/js/property_directory_control.js. 
​
Add your event (click/change) and call function wpestate_directory_filtering_action in the same file
In that function read the new field and send it via ajax call to the PHP function wpestate_classic_ondemand_directory .
​
This function is located in wpresidence/libs/ajax_functions.php  ,  and in there you need to retrieve the new field and use it in the Wp_Query arguments.
If your field is a taxonomy follow the example for property status – the $status_array that is added into ‘tax_query’  parameter
If your field is a meta value follow the example for property_size . See how size array is build and added into $meta_query array. Also please note that on property_size  we do a “”Between” search.
Technical how to | Custom Code

Related Articles

  • How to Add Custom Fields to the Login, Register and Forgot Password Forms
  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
MLSImportWordPress IDX Plugin for MLS ListingsImport MLS listings into your WordPress website, customize your property pages, and keep your inventory updated.Start free 30-day trial →

Help Categories

  • 111 Installation & Changelog
  • 19Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 14Footer
  • 38Header
  • 2IDX & MLSImport
  • 23Maps & Location Settings
  • 50Multilingual Websites – WPEstate Translate (Included)
  • 21Pages & Page Templates
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 38Property Single Page
  • 32Search & Filtering
  • 170Technical how to | Custom Code
  • 9Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 6Theme Translation & Localization
  • 28Third Party Plugins Compatible
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 9WPResidence Elementor Studio
  • 39WPResidence Elementor Widgets
  • 79WPResidence FAQ

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API