{CODICTS} Snippets is now available

MyListing Measurement Field

The {CODICTS} MyListing Measurement Field plugin adds a custom Measurement field type and a corresponding Measurement filter type to MyListing’s listing type editor. It lets you collect and filter precise measurement data — length, weight, or volume — in both imperial and metric formats.

The field renders as an interactive slider on the add-listing form, and the filter renders as a range slider (or single slider) on the explore page. The plugin supports automatic value formatting, abbreviated and full-format display, and a special feet/inches symbol conversion mode for height-style measurements.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

On activation, the plugin automatically copies its template files to your child theme. There is no settings page — all configuration is done through the MyListing listing type editor.


Key Features

FeatureDescription
Custom Measurement FieldA new field type in the listing type editor with slider-based input for collecting measurement data.
Imperial & Metric SupportSupports length, weight, and volume measurements across 21 unit types in both measurement systems.
Slider InputUsers input measurements by dragging an interactive slider on the add-listing form.
Measurement FilterA corresponding filter type for the explore page with range slider (min–max) or single slider (threshold) modes.
Feet/Inches Symbol ModeSpecial display mode for imperial feet that shows values as 5" 11' (feet and inches).
Value FormattingOptional number formatting with thousands separators (e.g., 12,500).
Display ModifiersTwo output modifiers for templates: full_format (e.g., “5 feet”) and abbr_format (e.g., “5 ft”).
Dynamic Filter RangeThe explore filter automatically calculates its min/max range from existing listing data.

Supported Measurement Units

Imperial Units

CategoryAbbreviationFull Name
Lengthininches
ftfeet
ydyards
mimiles
Weightozounces
lbspounds
ststones
Volumefl ozfluid ounces
ptpints
qtquarts
galgallons

Metric Units

CategoryAbbreviationFull Name
Lengthmmmillimeters
cmcentimeters
mmeters
kmkilometers
Weightmgmilligrams
ggrams
kgkilograms
tmetric tons
Volumemlmilliliters
clcentiliters
lliters

Adding a Measurement Field to a Listing Type

1. Navigate to WP Admin → Listing Types and edit a listing type.

2. Go to the Fields tab.

3. In the right-hand column, click the {C} Measurement button (added by the plugin).

4. A new measurement field is added to your field list. Configure its settings (see below).

5. Save the listing type.

Field Configuration Options

SettingDefaultDescription
Label{C} MeasurementThe field label displayed to users on the add-listing form.
KeyAuto-generatedUnique field key used as the meta key.
DescriptionOptional help text shown below the field.
UnitMetricThe measurement system: Imperial or Metric.
TypeVaries by unitThe specific measurement type (e.g., feet, kilograms, liters). Options change based on the selected unit system.
Use abbreviationsCheckedWhen checked, displays abbreviations (e.g., “ft” instead of “feet”).
Convert to formatted stringUncheckedEnables feet/inches symbol display (e.g., 5" 11'). Only visible when Unit is Imperial and Type is Feet.
Format numeric valueCheckedFormats numbers with thousands separators (e.g., 12,500).
Minimum value0The minimum allowed value on the slider.
Maximum value100The maximum allowed value on the slider.
Step1The increment step for the slider.
RequiredWhether the field is required on submission.
Show in submit formWhether to show on the add-listing form.
Show in adminWhether to show in the admin post editor.
Show in compareWhether to include in listing comparison.

How the Slider Works

On the add-listing form, the measurement field appears as a horizontal slider with a display label showing the current value and unit suffix. The user drags the slider handle to select a value within the configured minimum and maximum range.


Adding a Measurement Filter to the Explore Page

1. Navigate to WP Admin → Listing Types and edit a listing type.

2. Go to the Explore / Search tab.

3. Add a new filter and select {C} Measurement as the filter type.

4. In the Source field dropdown, select the measurement field you created.

5. Configure the filter settings (see below).

6. Save the listing type.

Filter Configuration Options

SettingDefaultDescription
Label{C} MeasurementThe filter label displayed on the explore page.
Source fieldThe measurement field to filter by. Only measurement fields are shown in the dropdown.
TypeRange sliderRange slider: two handles for selecting a min–max range. Single slider: one handle for a threshold value.
BehaviorLowerOnly visible for Single slider mode. Lower: shows listings with values at or below the slider value. Upper: shows listings with values at or above the slider value.
Step size1The increment step for the filter slider.
Format numeric valueCheckedFormats numbers with thousands separators in the filter display.

Dynamic range: The filter automatically calculates its minimum and maximum values from the actual data in your published listings. If no listings have values, both min and max default to 0.


Display Modifiers for Templates

You can control how the measurement value appears in listing templates and dynamic tags using modifiers:

UsageOutput ExampleDescription
[[field_key]]5 ft or 5 feetUses the field’s configured abbreviation setting.
[[field_key:full_format]]5 feetForces the full unit name regardless of the abbreviation setting.
[[field_key:abbr_format]]5 ftForces the abbreviated unit regardless of the abbreviation setting.

Note: When feet/inches symbol mode is active, the value always displays as 5" 11' format and modifiers are ignored.


Feet/Inches Symbol Mode

The symbol mode is a special display feature available only when the field is set to Imperial unit and Feet type with “Convert to formatted string” enabled.

When active, values are stored internally as total inches. The slider operates in inch increments, and the display converts the value to a feet-and-inches format:

Stored Value (inches)Display Output
605" 0'
715" 11'
726" 0'
756" 3'

When configuring the field, the Minimum and Maximum values represent feet. The plugin automatically converts them to inches internally. For example, setting Min to 4 and Max to 7 creates a slider from 48 to 84 inches, with a step of 1 inch.


Example Setup: Weight Field (Metric)

1. Edit your listing type and go to the Fields tab.

2. Click {C} Measurement to add a new field.

3. Set Label to “Weight,” Unit to Metric, Type to kg (kilograms).

4. Set Minimum to 0, Maximum to 500, Step to 1.

5. Check “Use abbreviations” and “Format numeric value.” Save.

6. Go to the Explore / Search tab. Add a new filter, select {C} Measurement.

7. Set Source field to “Weight,” Type to Range slider, Step to 5. Save.

8. On the add-listing form, users see a slider from 0 to 500 kg. On the explore page, visitors can filter listings by a weight range — the slider automatically adjusts to the min/max of your actual listing data.

Example Setup: Height Field (Imperial Feet/Inches)

1. Edit your listing type and go to the Fields tab.

2. Click {C} Measurement to add a new field.

3. Set Label to “Height,” Unit to Imperial, Type to ft (feet).

4. Check “Convert to formatted string” to enable feet/inches symbol mode.

5. Set Minimum to 4 (feet), Maximum to 7 (feet). The slider will operate from 48 to 84 inches internally.

6. Save. On the add-listing form, the slider displays values like 5" 11' as users drag it.


Frequently Asked Questions

Does this require a child theme?

Yes. The plugin copies template files to the child theme directory. Without a child theme, the templates cannot be installed and the plugin will not function.

Is there a settings page?

No. All configuration is done through the MyListing listing type editor — the field is configured in the Fields tab, and the filter is configured in the Explore/Search tab.

Can I use both imperial and metric on the same listing type?

Yes. Each individual measurement field can only use one unit system, but you can add multiple measurement fields to a listing type, each with a different unit and type.

How does the feet/inches symbol mode work?

When enabled for imperial feet, the slider operates in inches internally. The Min and Max values you configure represent feet but are converted to inches (multiplied by 12). The display shows the converted feet/inches format (e.g., 5" 11'), and the stored value is total inches.

How are the filter’s min/max values determined on the explore page?

They are dynamically calculated from the actual data in your published listings. The filter queries the database to find the lowest and highest values across all published listings of that type. If no listings have values, both default to 0.

What are the display modifiers?

Use [[field_key:full_format]] for full unit names (e.g., “5 feet”) or [[field_key:abbr_format]] for abbreviations (e.g., “5 ft”) in listing templates and dynamic tags. When symbol mode is active, modifiers are ignored and the value always displays as feet/inches.

What’s the difference between Range and Single slider filter modes?

Range slider has two handles for selecting a min–max range (e.g., 50–200 kg). Single slider has one handle for a threshold value with configurable behavior: “Lower” shows listings at or below the value, “Upper” shows listings at or above.

What happens when I deactivate the plugin?

All copied template files are removed from the child theme, and the measurement field type is no longer available. Existing measurement data stored in listing meta fields is preserved — it is not deleted. Re-activating restores the templates.

Will my customizations to the template files be preserved on update?

No. On plugin activation and version updates, the template files in the child theme are overwritten with the plugin’s versions. If you customize these templates, be aware that updates will overwrite your changes.


Troubleshooting

{C} Measurement Button Not Appearing in Listing Type Editor

CauseSolution
Templates not installedDeactivate and reactivate the plugin to trigger template installation. Ensure both the MyListing theme and a child theme are active.
Not on the Fields tabThe button only appears when viewing the Fields tab in the listing type editor.
Plugin not activatedGo to Plugins → Installed Plugins and verify the plugin is active.

Slider Not Appearing on Add-Listing Form

CauseSolution
“Show in submit form” not checkedEdit the field in the listing type editor and ensure “Show in submit form” is enabled.
Template files missingDeactivate and reactivate the plugin to re-copy the template files to the child theme.
No child theme activeThe plugin requires a child theme. Check Appearance → Themes.
jQuery UI not loadedThe slider relies on jQuery UI which is provided by MyListing. Ensure the theme is functioning correctly.

Filter Not Working on Explore Page

CauseSolution
No source field selectedEdit the filter in the listing type’s Explore tab and make sure a measurement field is selected in the “Source field” dropdown.
No listing dataThe filter’s min/max range is calculated from published listings. If no listings have values for the measurement field, the filter will show 0 to 0. Add some listings with measurement data.
Template files missingDeactivate and reactivate the plugin to re-copy templates.

Feet/Inches Display Not Working

CauseSolution
Wrong unit or typeSymbol mode is only available when Unit is set to Imperial and Type is set to Feet. It does not work with any other measurement type.
“Convert to formatted string” not checkedEdit the field and enable the “Convert to formatted string” checkbox. It only appears when Unit is Imperial and Type is Feet.

Values Look Wrong or Display Incorrectly

CauseSolution
Number formatting offIf large numbers appear without commas (e.g., 12500 instead of 12,500), edit the field and enable “Format numeric value.”
Wrong abbreviation settingIf you see “feet” instead of “ft” (or vice versa), check the “Use abbreviations” setting on the field, or use the :full_format or :abbr_format modifier in your template.

Template Overwrite Warning

The following template files in your child theme are managed by this plugin and will be overwritten on activation and updates:

templates/add-listing/form-fields/measurement-field.php
templates/admin/listing-types/filters/measurement-filter-options.php
templates/explore/filters/measurement.php

Do not make customizations to these specific files, as they will be lost on the next plugin update.

“MyListing Theme Not Detected” or “Child Theme Not Detected” Error

The MyListing theme and a child theme must both be installed and active. Go to Appearance → Themes to verify.


For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved