Make the Email Clickable in the More Info Section

The “more info” section in the search results shows the details you place there with the “Location(s) of …” settings under Store Locator > Settings > User Experience. To show the email address there, select “The “more info” section in the search results” for “Location(s) of contact details”.

The email address is a link when “Make the contact details always clickable?” is enabled on the same tab. If you don’t see that option, or you only want the link in the more info section, use the wpsl_more_info_template filter. The code below replaces the email address in the default more info template with a mailto link. The rest of the template stays as the plugin builds it, so it keeps following your settings.

add_filter( 'wpsl_more_info_template', 'custom_more_info_clickable_email' );
function custom_more_info_clickable_email( $more_info_template ) {
// Always link the email address, whatever the clickable setting is.
$more_info_template = str_replace(
'<%= formatEmail( email ) %>',
'<a href="mailto:<%= email %>"><%= email %></a>',
$more_info_template
);
return $more_info_template;
}

Copy the above code and place it in the functions.php inside your active theme folder. Reload the store locator page, and locations that have an email address set will now show a clickable email address in the more info section.

If it doesn’t work, check that no custom List section is activated under Store Locator > Settings > Fields Manager > Section Editor: an active section replaces this filter. In that case, make the change in the Section Editor instead, as described in Include Contact Details in the Search Results. Also clear the cache of any caching plugin, and your browser cache.