acf-code-field icon indicating copy to clipboard operation
acf-code-field copied to clipboard

Echo statement within HTML not outputting correctly.

Open joshuaiz opened this issue 6 years ago • 0 comments

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!

joshuaiz avatar May 22 '18 04:05 joshuaiz