WP Residence Help WP Residence Help

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

Technical: Add a new filter to Property Directory List

3719 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 Required

Related Articles

  • 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
  • Introduction to WPResidence Header Customization

Help Categories

  • 18Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 39Elementor Shortcodes Built-In
  • 46FAQ
  • 15Footer
  • 5Getting Started
  • 37Header
  • 2IDX & MLSImport
  • 6Installation & Setup
  • 24Installation FAQ
  • 23Maps & Location Settings
  • 21Multi-Language - Third Party Plugins
  • 6Other Third party Plugins
  • 21Pages
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 37Property Pages & Layouts
  • 31Search & Filtering
  • 162Technical how to | Custom Code Required
  • 8Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 7Translations & Languages
  • 16WPBakery Shortcodes
  • 50WPEstate / WPResidence Translate Plugin
  • 51WPResidence / WPEstate CRM
  • 50WPResidence 5.0 Documentation
  • 9WPResidence Elementor Studio

Join Us On

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