Placeholders are used to display extra information about a location in the info window. WP MAPS PRO allows you to create unlimited extra fields and show them in both the map listing and marker info windows.
Sometimes, you may have multiple placeholders for different types of locations but use the same info window template for all of them. In such cases, if a placeholder has no value for a specific location, its label will still be displayed — leaving an empty label in the info window, which doesn’t look professional.
Problem:
Consider the following example where extra fields are displayed with labels:
Rating – {ratings} Hours – {hours} Website – {website}
In this setup, if a location does not have a rating, hours, or website, the label will still appear, but without any value, like this:
As you can see, the info window shows blank labels for fields without data.
Solution:
Wrap each label and its placeholder inside a <div>
tag. This ensures that if the placeholder value is empty, the entire label and value block is hidden automatically.
Example:
<div><strong>Rating –</strong> {ratings}</div> <div><strong>Hours –</strong> {hours}</div> <div><strong>Website –</strong> {website}</div>
By using this method, the label will only be displayed if its corresponding placeholder has a value. This keeps your info windows clean and professional.
Need help? Submit a support ticket and we’ll assist you!