Add Custom Information to the Map Marker Popup
Adding custom information to the map marker popup is simple and allows for an easy way to display additional information about a listing without having to click through.
Add the Custom Data
The first step is to pass the data we want to add to our listing result item. This can be done with the
listify_listing_data filter. In this example I will display the date the listing was added.
Add the following code to your child theme's
This code simply adds another item to the array of information passed to each listing item when it is output.
Modify the Marker Popup Template
Next we need to move the
templates/tmpl-map-popup.php template file to the child theme so we can safely modify it. Copy it to
Once added to our child theme we can access the
date_added key we created earlier. So our new template may look like:
Specifically lines 62-63 which use the Mustache template system to output the new item.
Note: Escaped HTML
The data is passed to each listing via HTML data attributes and therefore must not contain any unescaped HTML.
We are partnered with and highly recommend WP Curve (https://astoundify.com/go/wpcurve) Envato Studio (https://astoundify.com/go/envato-studio/) or Codeable (https://astoundify.com/go/codeable/) If you need help customizing your theme.