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
jobify_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
tmpl/tmpl-infobubble.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 21-23 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.