WP Residence Help WP Residence Help

  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code Required, WpResidence 5.0 / WpResidence Agent Card Templates Guide

WpResidence Agent Card Templates Guide

582 views 0

WpResidence Agent Card Templates Guide

Introduction

WpResidence theme offers multiple agent card templates to display agent information in various styles. This guide covers four main templates: agent_unit.php, agent_unit_v2.php, agent_unit_v3.php, and agent_unit_v4.php. Each template is located in the templates/agent_card_templates/ directory of the theme.

1. agent_unit.php

This is the default agent card template. It displays a comprehensive view of the agent, including their image, name, position, and contact details.

Key CSS Classes:

  • .wpresidence_agent_unit_wrapper: Main wrapper for the agent card. Styles found in scss/agent_cards/_agent_unit.scss.
  • .agent_unit: Container for the agent information. Styles in scss/agent_cards/_agent_unit.scss.
  • .agent-unit-img-wrapper: Wrapper for the agent’s image. Styles in scss/agent_cards/_agent_unit.scss.
  • .agent_unit_social: Container for social media icons. Styles in scss/agent_cards/_agent_unit.scss.
  • .agent_position: Agent’s job position. Styles in scss/agent_cards/_agent_unit.scss.
  • .agent_detail: Container for each detail (phone, email, etc.). Styles in scss/agent_cards/_agent_unit.scss.

Example of customizing the agent card:


// Add to your child theme's style.css
.agent_unit {
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.agent_position {
font-style: italic;
color: #888;
}

2. agent_unit_v2.php

This template provides a more compact view, focusing on the agent’s image with overlaid text.

Key CSS Classes:

  • .agent_card_2: Main wrapper for this card style. Styles found in scss/agent_cards/_agent_unit_v2.scss.
  • .property_listing.places_listing: Container for the agent information. Styles in scss/agent_cards/_agent_unit_v2.scss.
  • .realtor_position: Agent’s job position. Styles in scss/agent_cards/_agent_unit_v2.scss.
  • .realtor_name: Agent’s name. Styles in scss/agent_cards/_agent_unit_v2.scss.

Example of customizing the v2 agent card:


// Add to your child theme's style.css
.agent_card_2 .property_listing.places_listing {
height: 400px; // Increase card height
}
.agent_card_2 .realtor_name {
font-size: 24px;
text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

3. agent_unit_v3.php

This template offers a more detailed view, including a “My Listings” button and featured agent notes.

Key CSS Classes:

  • .agent_card_3: Main wrapper for this card style. Styles found in scss/agent_cards/_agent_unit_v3.scss.
  • .agent_unit_featured: Container for featured agent information. Styles in scss/agent_cards/_agent_unit_v3.scss.
  • .featured_agent_notes: Container for agent notes. Styles in scss/agent_cards/_agent_unit_v3.scss.
  • .featured_agent_listings.wpresidence_button: “My Listings” button. Styles in scss/agent_cards/_agent_unit_v3.scss.

Example of customizing the v3 agent card:


// Add to your child theme's style.css
.agent_card_3 .agent_unit_featured {
border: 1px solid #ddd;
border-radius: 15px;
overflow: hidden;
}
.agent_card_3 .featured_agent_listings.wpresidence_button {
background-color: #4CAF50;
color: white;
}

4. agent_unit_v4.php

This template provides a minimalist design, focusing on essential information with a clean layout.

Key CSS Classes:

  • .agent_card_4: Main wrapper for this card style. Styles found in scss/agent_cards/_agent_unit_v4.scss.
  • .agent_unit.agent_unit_type_4: Container for agent information. Styles in scss/agent_cards/_agent_unit_v4.scss.
  • .agent-unit-img-wrapper: Wrapper for the agent’s image. Styles in scss/agent_cards/_agent_unit_v4.scss.
  • .agent_position: Agent’s job position. Styles in scss/agent_cards/_agent_unit_v4.scss.

Example of customizing the v4 agent card:


// Add to your child theme's style.css
.agent_card_4 .agent_unit.agent_unit_type_4 {
text-align: center;
padding: 20px;
background-color: #f9f9f9;
}
.agent_card_4 .agent-unit-img-wrapper img {
border: 3px solid #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

Extending Functionality

To customize these templates, you can copy them to your child theme and modify as needed. Here’s an example of how to add a custom field to the agent card:


<?php
// Add this to your copied template file
$custom_field = get_post_meta(get_the_ID(), 'agent_custom_field', true);
if (!empty($custom_field)) {
echo '<div class="agent_custom_field">' . esc_html($custom_field) . '</div>';
}
?>

Then, add the corresponding CSS to your child theme’s style.css:


.agent_custom_field {
margin-top: 10px;
font-style: italic;
color: #666;
}

Selecting Different Card Styles

The card style used is determined by the wpestate_agent_card_selector() function in libs/agent_functions.php. You can override this function in your child theme to always use a specific card style:


function custom_agent_card_selector() {
return 'templates/agent_card_templates/agent_unit_v3.php';
}
add_filter('wpestate_agent_card_selector', 'custom_agent_card_selector');

This example always uses the v3 card style. Adjust the template path as needed for other versions.

Technical how to | Custom Code RequiredWpResidence 5.0

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