{CODICTS} Snippets is now available

Voxel Location Radius Field

The {CODICTS} Voxel Location Radius Field plugin extends the Voxel Theme by adding a new Location Radius field type and matching search filter. It allows post authors to define a geographic location with a configurable radius — ideal for delivery zones, service areas, coverage regions, and any use case where a location needs an associated range. Visitors can then search for posts whose radius covers their location.

Requirements

Important: This plugin requires a Voxel child theme to be active. The plugin installs modified template files into the child theme to enable its functionality. If no child theme is detected, the plugin will display an admin notice and will not load.

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 installs required template files into your active Voxel child theme. No settings page is needed — the plugin adds a new field type and filter type directly into the Voxel system.

Note: When you deactivate or uninstall the plugin, the template files are automatically removed from your child theme. If you switch to a different child theme, the files are cleaned up from the old theme automatically.


What This Plugin Solves

Voxel’s built-in location field stores an address with latitude/longitude coordinates, but it doesn’t support defining a radius around that location. Businesses like restaurants with delivery zones, service providers with coverage areas, or venues with reach zones need to specify not just where they are, but how far their service extends.

This plugin adds that missing piece — a location field with a radius slider, plus a search filter that finds posts whose defined radius covers the visitor’s location.


Key Features

FeatureDescription
Location + Radius FieldAddress autocomplete with a configurable radius slider (min, max, step, units).
Reverse Radius SearchVisitors search by entering their location — the filter finds posts whose stored radius covers that location.
Visual Radius on MapsSemi-transparent colored circle drawn on the map representing the service/delivery area.
Multi-Map SupportWorks with Google Maps, Mapbox GL JS, and OpenStreetMap (Leaflet).
Kilometers & MilesChoose between km and mi for each field independently.
Dynamic Data TagsUse address, lat, lng, radius, and distance values in Voxel templates.
Customizable Radius ColorColor picker in the Map widget or PHP filter hook for programmatic control.

Adding a Location Radius Field to a Post Type

Step 1: Open the Post Type Editor

In the WordPress admin, go to Voxel → Post Types and select the post type you want to add the field to (e.g., “Restaurants”, “Services”).

Step 2: Add the Field

In the Fields tab, click “Add Field”. Look for “{C} Location Radius” in the field type list and add it.

Step 3: Configure the Field

Click on the newly added field to expand its settings:

SettingDefaultDescription
Label{C} Location RadiusThe field label shown to users on the create/edit post form.
KeyThe field slug used internally (e.g., delivery_area).
PlaceholderPlaceholder text for the address input.
Radius LabelDelivery RadiusLabel shown above the radius slider.
Radius DescriptionOptional description text below the radius label.
Radius Default10Starting value of the radius slider.
Radius UnitskmKilometers (km) or Miles (mi).
Radius Min0Minimum slider value.
Radius Max100Maximum slider value.
Radius Step1Slider increment (supports decimals).
RequiredOffWhether this field must be filled in to submit the post.

Step 4: Save the Post Type

Click “Save Changes” on the post type. The Location Radius field is now available on the create/edit post form for this post type.


How Authors Use the Field

When a post author creates or edits a post with a Location Radius field, they see:

1. Address Input — An autocomplete address field. The author types an address and selects from suggestions, or clicks “Use my current location”.

2. Map Picker (Optional) — A “Pick on the map” toggle that opens an interactive map where the author can click to set or adjust the pin location.

3. Radius Slider — A smooth slider to set the radius value. The slider respects the min, max, step, and units you configured.

When the map picker is open, a semi-transparent colored circle is drawn around the marker, visually representing the radius. As the author adjusts the slider, the circle updates in real time and the map auto-zooms to fit.


Adding the Search Filter

To let visitors search for posts whose radius covers their location, add the Location Radius search filter.

Step 1: Open the Post Type Filters

In Voxel → Post Types → [Your Post Type], go to the Search Filters (or Templates) section where you configure filters for the search form widget.

Step 2: Add the Filter

Add a new filter and select “{C} Location Radius” as the filter type.

Step 3: Configure the Filter

SettingDescription
LabelThe filter label shown on the search form.
PlaceholderPlaceholder text for the address input.
SourceSelect the Location Radius field this filter queries against.
Radius Unitskm or mi (should match the field’s units).
IconIcon displayed on the filter in the search form.

Step 4: Re-Index the Post Type

After adding the filter, you must re-index the post type for the spatial data to be created. Go to Voxel → Post Types → [Your Post Type] → Index and click “Re-index”.

Important: Re-indexing is required after adding or changing the Location Radius filter. Without it, the search will return no results.


How the Search Works

The Location Radius filter performs a “reverse radius” search — the opposite of a typical proximity search:

Traditional Proximity SearchThis Plugin’s Reverse Radius Search
Visitor enters their location + a radius → finds posts within that radiusVisitor enters their location → finds posts whose stored radius covers the visitor’s location

For example, if a restaurant has set a 15 km delivery radius and a visitor searches from an address 10 km away, that restaurant will appear in the results. If the visitor is 20 km away, it won’t.

The search uses the Haversine formula for accurate great-circle distance calculations, accounting for the Earth’s curvature.

Visitors can enter their address, use their current location, or use the “Visible map area” option on the search form.


The {C} Map (VX) Widget

The plugin automatically enhances the Voxel Map Elementor widget (renamed to “{C} Map (VX)”) with radius circle support. This happens through the template override — no manual setup is required.

Radius Circles on the Map

When viewing a single post on a map, the post’s radius is drawn as a semi-transparent colored circle around its marker.

When viewing search results on a map, each result post that has a Location Radius field displays its own radius circle.

Customizing the Radius Color

In the Elementor editor, select the Map widget and look for the “{C} Radius Settings” section in the Content tab. Use the color picker to set the radius circle color.

The default color is dark red (#AA0000).

For developers: You can also set the color programmatically using a PHP filter:

add_filter('codicts_voxel_location_radius_field::radius_color', function($color) {
    return '#00FF00'; // Green radius circles
});

Note: The PHP filter takes priority over the Elementor color picker setting.


Supported Map Providers

The plugin works with all three map providers available in the Voxel Theme:

ProviderRadius CircleAuto-Zoom
Google MapsCircle overlay that follows the marker position automatically.Fits map bounds to the circle.
Mapbox GL JSCircle layer that scales correctly across zoom levels.Fits map bounds with padding.
OpenStreetMap (Leaflet)Leaflet circle with configurable styling.Fits map bounds with padding.

The plugin automatically detects which map provider you have configured in Voxel and uses the appropriate rendering method.


Dynamic Data Tags

The Location Radius field exposes the following dynamic data tags for use in Voxel templates and Elementor dynamic tags:

TagExample OutputDescription
address123 Main St, New York, NY 10001Full geocoded address.
short_address123 Main StFirst part of the address (before first comma).
medium_address123 Main St, New YorkFirst two parts of the address.
long_address123 Main St, New York, NYAll but the last part (typically excludes the country).
lat40.74844Latitude coordinate.
lng-73.98565Longitude coordinate.
radius15 kmRadius value with unit.

Distance Tags

When used with a “Nearby” order in a Voxel post feed, the following distance tags become available:

TagExample OutputDescription
distance.meters5432Distance from the search point in meters.
distance.kilometers5.432Distance in kilometers.
distance.miles3.375Distance in miles.

Note: Distance tags require a “Nearby” order on the post feed to function, as they depend on a reference search point.


Common Use Cases

Use CaseField Label ExampleTypical Radius Range
Restaurant delivery zonesDelivery Radius1–30 km
Service provider coverageService Area5–100 km
Freelancer travel willingnessWilling to Travel10–200 km
Event venue reachEvent Coverage5–50 km
Utility service zonesCoverage Zone1–500 km

Troubleshooting

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

Ensure the Voxel Theme is installed and that a Voxel child theme is set as the active theme — not the parent Voxel theme directly. Go to Appearance → Themes and verify your active theme shows “Parent: Voxel”.

Field Not Appearing in the Post Type Editor

Make sure the plugin is activated and the template files were installed correctly. Try deactivating and reactivating the plugin to force a template reinstall. Clear any object cache (Redis, Memcached) if you use one.

Search Returns No Results

The most common cause is a missing re-index. After adding the Location Radius filter to a post type, you must re-index: go to Voxel → Post Types → [Your Post Type] → Index and click “Re-index”. Also verify that the search location is actually within the radius of at least one post, and that the filter’s Source is set to the correct Location Radius field key.

Radius Circle Not Showing on the Map

The map widget should automatically be the enhanced {C} Map (VX) version via the template override. Check the browser console for JavaScript errors. Verify the post has a Location Radius field with a valid radius value (not 0 or empty). For Mapbox, the circle is drawn after the map fully loads — give it a moment.

Radius Color Not Changing

Check the {C} Radius Settings section in the Elementor Map widget settings. If you are using the PHP filter hook, it takes priority over the Elementor setting. Make sure the filter returns a valid hex color string like #00FF00.

Radius Slider Not Appearing

The slider uses the noUiSlider library bundled with Voxel. If Voxel’s assets aren’t loading correctly, the slider won’t appear. Check the browser console for “noUiSlider is not defined” errors.

Templates Not Updating After Plugin Update

The plugin automatically checks and updates templates on every page load. If templates aren’t updating, try deactivating the plugin, manually deleting the template files from your child theme, and then reactivating.

Plugin Breaks After a Voxel Theme Update

Major Voxel theme updates can change internal template structures. Check for a plugin update from CoDicts after updating Voxel. If issues persist, deactivate the plugin temporarily until a compatible version is released.


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

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