I would try
if ( $map && $map != "" )
as you set the variable, but it can also contain an empty string.
Related Posts:
- Show posts on a Google Map
- Plot location on Google map using full address specified in custom field
- Querying posts by latitude and longitude to build a Google Maps with several markers
- Google map that plot’s several markers – each one with custom data
- Is there a way to set default custom fields when creating a post?
- Underscores in custom fields
- Add custom field to the archive page?
- Pre-filling custom fields on New Post
- So much data in postmeta
- Show only posts which can be commented OR have custom meta field
- Need small coding with Custom Fields Search
- Show Custom Comment Fields when editing in admin
- How do I make a custom field choose an image?
- get_post_meta() unserialize issue – returns boolean(false)
- How can I remove fields in the attachment editor?
- Edit Custom Database Tables in WordPress
- How to store the value of a custom field dropdown select for post referencing?
- Gutenberg Custom Block
- Up/Down voting system for WordPress
- Custom Meta Field not Working with qTranslate [closed]
- Change content before writing to database
- post meta data clearing on autosave
- WordPress Search Custom Meta Field Only
- Problem in custom meta boxes
- Loop through two different sets of custom fields
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Add description text under input field for new profile fields
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Echo values from custom field outside loop php
- How to add content at the end of posts?
- sort search results by custom fields using dropdown
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Get all posts that do not have a specific custom field without using a subquery
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- How to query posts with certain custom meta data, and output Post data
- Custom Fields Not in Search Results
- How to loop through certain custom field values
- add_action and remove_action if custom field exists
- wordpress custom fields multiple data
- How do I define post titles as images using Custom Fields?
- Store array as single, serialized post meta field or many post meta fields?
- Get an advanced custom field after post publish
- Why the pagination for a query modified by pre_get_posts doesn’t mind the number & order of posts sorted & selected based on a custom date time field
- update_post_meta for repeated custom field [closed]
- Trying to update_post_meta function
- How do i add custom fields to my themes template file?
- Custom Field to a Role?
- Delete custom fields when deleting posts
- Pull custom fields from custom posts within a loop
- Ordering posts by custom field named “date” in backend
- How to pass page as an argument like post in WordPress?
- How to display custom fields from a plugin
- Adding “meta” info to WP site PHP function?
- WordPress Media Uploader custom Javascript not working
- Custom fields issue [closed]
- Select custom posts by meta_value and sort by a different meta value
- List custom queried terms in the edit-tags.php?taxonomy page
- Display meta box dropdown (from custom post type) in the page post type
- Front end register with custom fields
- how can I show name and value of Custom Fields together?
- Adding simple (one button) Audio player using Custom Fields?
- Display custom field from the front page on another page
- No result update a custom field using wp_schedule_event
- Display custom widget value in header.php
- Gravity Forms Update post meta from template [closed]
- Automatic linking terms
- Adding extra fields to front end signup form
- Problem uploading different files as custom fields with front end post form
- How to change order of posts in admin
- Display metabox title for custom fields with values
- wpdb function insert doesn’t work
- make a dropdown custom field with ‘cities’ list in it
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Get Custom Field Name ( Label or Key ) Not Value
- Custom field on Quick Edit using select/dropdown – almost working right but not showing currently selected value
- Adding Custom Metadata to my Archive/Posts page
- Move the post title to another field
- Ordering by ACF custom field vaule
- add different custom fields value to post class if permalink or index
- User Filter Options on Archive Page
- Create Shortcode shows only posts with custom_field meta
- Login_form add to top of form rather then bottom
- Advanced Custom Fields from Category – IF statement
- Search one custom field?
- Can’t save meta field value if the title not set
- Get a different meta value with ajax when different elements are clicked
- Delete custom fields on post publish?
- Why is wp_list_pages altering $post->ID of the page?
- How do you turn a custom field’s value into a permalink for that post?
- Permalink structure depending on custom field
- How to add custom_fields value in JSON API using create_post
- How to keep sharing stats after creating 301 redirects?
- Using Hooks. Thematic
- Display posts where date field matches current month?
- Parse Shortcodes in Theme’s Custom Field?
- Update field name without losing the value
- Custom field for image, not showing image!
- How can i put a custom field inside this php
- Conditional display based on ACF checkbox
- How to add an ACF only for parent term?