acf-code-field
acf-code-field copied to clipboard
Echo statement within HTML not outputting correctly.
Hello, Love the plugin. I have the following in my ACF field which I am using to display the raw code.
<?php $color = get_sub_field( 'color' ); ?>
<li class="color-tile">
<div class="swatch" style="background-color:<?php echo $color; ?>"></div>
</li>
However on the front end I get this:
<?php $color = get_sub_field( 'color' ); ?>
<li class="color-tile">
<div class="swatch" style="background-color:___PHP6___"></div>
</li>
How can I spit out that code exactly as it is? Do I need to escape it if it is in quotes or something?
Thanks!