Executing ACF field as a shortcode

you are trying to output the value of an ACF field containing an embed code for a Google Map as a shortcode within your WP theme files . If the shortcode is not being executed, the get_field() function may be returning the raw value of the field rather than parsing it as a shortcode.

Replace your_google_map_shortcode with the actual shortcode name that you’re using for embedding the map.

<?php
// Check if the custom field has a value
if (get_field('zemelapis')) {
    // Get the raw value of the field
    $field_value = get_field('zemelapis');

    // Check if the field value contains a shortcode
    if (has_shortcode($field_value, 'your_google_map_shortcode')) {
        // Execute the shortcode
        echo do_shortcode($field_value);
    } else {
        // If no shortcode found, output the raw value
        echo $field_value;
    }
}
?>

tech