Solved, this did the trick
https://support.advancedcustomfields.com/forums/topic/how-to-use-the_field-data-inside/
Yup, that will work. When it is done that way, the script tag can end up in rather odd position on the page. Plus modifying templates is not always optimal. FWIW, there is a more organized, formal way to do this. See
https://developer.wordpress.org/reference/functions/wp_localize_script/
Ohh nice thank you!! oj I used this
<script type="application/ld+json">
var recipeName = '<?php echo the_field('recipe_name'); ?>';
</script>
and not this, sorry I realize I didn’t specify which method I used…
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Recipe",
"name": "<?php the_field('recipe_name'); ?>",
"image": "http://images.media-allrecipes.com/userphotos/600x600/1116471.jpg",
"author": {
"@type": "Person",
"name": "scoopnana"
}
}
</script>
If I got it correctly the better way should be applied to the second code