WP Residence Help WP Residence Help

  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required / Technical how to : standard property list explained

Technical how to : standard property list explained

2315 views 0

The standard property list page file has the code in the property_list.php. The first thing you need to know is that we built the property list using the wp_query instruction from wordpress. If you plan to change the property list you need to be familiar with how the wp_query works. Detailed explanations can be found here : https://codex.wordpress.org/Class_Reference/WP_Query

In the property list file we load the settings you made in the wordpress admin (like category, city etc) . We do this at line 34

$current_adv_filter_search_action = get_post_meta ( $post->ID, 'adv_filter_search_action', true);
$current_adv_filter_search_category = get_post_meta ( $post->ID, 'adv_filter_search_category', true);
$current_adv_filter_area = get_post_meta ( $post->ID, 'current_adv_filter_area', true);
$current_adv_filter_city = get_post_meta ( $post->ID, 'current_adv_filter_city', true);

$show_featured_only = get_post_meta($post->ID, 'show_featured_only', true);
$show_filter_area = get_post_meta($post->ID, 'show_filter_area', true);

After that we start composing the taxonomy array that will be used in the arguments array we will pass to wp_query

If we want to show only featured properties we  use this code

if($show_featured_only=='yes'){
$compare_array=array();
$compare_array['key'] = 'prop_featured';
$compare_array['value'] = 1;
$compare_array['type'] = 'numeric';
$compare_array['compare'] = '=';
$meta_query[] = $compare_array;
}

For the order of the properties we use the switch block that starts around line 150

switch ($order){
case 1:

In the end we create the arguments array at line 198 and then load the template normal_map_core where we do the actual wp_query and display the properties list.

$args = array(
'post_type' => 'estate_property',
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => $prop_no,
'orderby' => 'meta_value_num',
'meta_key' => $meta_order,
'order' => $meta_directions,
'meta_query' => $meta_query,
'tax_query' => array(
'relation' => 'AND',
$categ_array,
$action_array,
$city_array,
$area_array
)
);

Technical how to | Custom Code Required

Related Articles

  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
  • Introduction to WPResidence Header Customization
  • Understanding WPResidence Header Types: An Overview
  • Customizing the WPResidence Logo Display

WP Residence Documentation

  • 1. General
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 2. Installation
  • 3. Installation FAQ
  • 4. Advanced Search
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 5. Agent, Agency & Developers
  • 6. Property Page
  • 7. Properties List
  • 8. Property Taxonomies
  • WpResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • Theme Options
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • Translation
  • FAQ
  • Pages
  • Header
  • Footer
  • Google or Open Street Maps
  • Payment Options
  • Plugins
    • Included Plugins
    • Third Party Plugins – IDX Compatibility
    • Third Party Plugins – Multi Languages
    • Third party Plugins – Other
  • Technical
    • Technical how to | Custom Code Required
    • Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API