I’m trying to link div with background images to wordpress. I added Post Field - Smart action to a div with a background-image, set the Field Id to a unique value and Edit as Background image.
Now in wordpress, when I reload the page preview, I get the error:
Parse error : syntax error, unexpected token “?” in C:\xampp\htdocs\xxx\wp-content\themes\xxx\page-test.php on line 3
If I change the Post Field from Background image to Image or Content, it works fine. But the moment, I use Background image, get the above error.
HTML in Pinegrow:
<div style="height: 80vh;" cms-post-field="test" cms-post-field-type="background-image"></div>
Generated PHP:
<div style="height: 80vh;background-image:<?php echo 'url('<?php echo get_template_directory_uri(); ?>/.PG_Image::getUrl( get_post_meta( get_the_ID('), 'test', true ), 'large' ).')' ?>;"></div>