WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 24. Technical how to | Custom Code Required / Technical – Add new measurement unit

Technical – Add new measurement unit

3914 views 0

How to Add a Custom Measurement Unit in WPResidence

WPResidence does not currently include a custom unit field in Theme Options by default.

The available measurement units are predefined in code, such as ft, m, ac, yd, and ha. If you want to add a different unit, for example kanal, this requires code changes in the core unit arrays and conversion tables.

Important

This is a custom code modification. It is not available as a built-in theme option.

The following information is provided only as a technical guide for developers. The example code is not tested and should be reviewed carefully before being used on a live website.

Files to Update

In the current structure, the custom unit must be added in the files below.

1. wpresidence-core plugin: admin-config.php

File:
plugins/wpresidence-core/redux-framework/admin-config.php

In this file, add the new unit to the following arrays:

  • $measure_array
  • $measure_array_lot_size

This makes the new unit selectable in Theme Options for both Property Size and Lot Size.

2. wpresidence-core plugin: convert_functions.php

File:
plugins/wpresidence-core/api/inc/convert_functions/convert_functions.php

In this file, you must:

  • Add the new unit in all measurement arrays used for conversion and formatting
  • Add the matching entries in the recalculation tables so the unit conversion works correctly
  • Update the logic that decides whether ² is appended for square-based units

This is the main file that controls how units are displayed and converted in the latest theme versions.

3. Theme file: widget_functions.php

File:
wp-content/themes/wpresidence/libs/widget_functions.php

If you use the Measurement Unit widget, add the new unit to the widget dropdown array in this file as well.

About the Old sup2 Note

In older notes, the recommendation may have been to edit a helper function to remove <sup>2</sup>.

In the latest theme versions, this is no longer the main path.

At the moment, the display of ² is controlled mostly in convert_functions.php and in the widget output logic, while the submit form labels now rely on the formatted unit functions.

After the Code Update

After adding the custom unit in code, go to:

Theme Options > Measurement Unit

Then select the newly added unit for:

  • Property Size
  • Lot Size

Save the changes and clear all cache layers, including any cache plugin, server cache, or CDN cache if enabled.

Developer Note

The following code changes are custom and are not part of the default WPResidence functionality.

Any implementation should be tested carefully in a staging environment first and reviewed by a developer before deployment on a live website.

24. 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

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 13. 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
  • 04. Theme Options & Global Settings
    • 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
  • 20. Translations & Languages
  • 26. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 19. Included Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 24. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

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