ACF gives a syntaxError unexpected token

You’re missing quotes around the content of innerHTML. If correctoutput is <div></div>, then you’re script looks like this: $(‘#correcto’).innerHTML(<div></div>); Which is invalid, because you’re missing quotes. innerHTML needs a string, which is in quotes in JavaScript. That first < is where your error is coming from. So you need to do this: $(‘#correcto’).innerHTML(‘<?php the_field(‘correctoutput’); ?>’); … Read more

ACF: Hide a div or template section when a custom field (in a field group) is empty

Hope this help how to figure out your request <?php $werdegang = ‘werdegang’; // werdegang parent group $station1 = ‘jahr_station_1’; // ‘ child group 1 $station2 = ‘jahr_station_2’; // ‘child group 2 $station3 = ‘jahr_station_3’; // ‘child group 3 $station1Jahr=”jahr1″; $station2Jahr=”jahr2″; $station3Jahr=”jahr3″; $station1Title=”jahr1_Title”; $station1Text=”jahr1_Text”; $station2Title=”jahr2_Title”; $station2Text=”jahr2_Text”; $station3Title=”jahr3_Title”; $station3Text=”jahr3_Text”; ?> <?php if( (!empty($station1Title) && !empty($station1Text)) && … Read more