WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / Technical how to : change agent details ( in agent page)

Technical how to : change agent details ( in agent page)

4180 views 0

The agent page  is displayed by the file single-estate_agent.php . In this page there are 3 main components:

The agent details which is located in templates/agentdetails.php

Here we display the agent details like phone, skype etc. The details are saved as custom meta for the estate_agent custom post type. They are retried using get_post_meta

$agent_phone = esc_html( get_post_meta($post->ID, 'agent_phone', true) );

The contact form located in templates/agent_contact.php

In this page we check if the the contact form is a contact 7 one and we display the right contact form. The WPResidence contact form email is sent via ajax when the button with id=”agent_submit” is pressed.

The Contact 7 buttons are displayed via code like

do_shortcode($contact_form_7_agent)

The agent listings code is located in  templates/agent_listings.php

In this file we do a wp_query that search for all properties assingned to the respective agent. The key element for this query is this portion of the $args array

'meta_query' => array(
array(
'key' => 'property_agent',
'value' => $agent_id,
)
)

If you need additiona details about how this is done you should read the meta query section from official documentation : https://codex.wordpress.org/Class_Reference/WP_Query

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