• I recently installed and configured my ACF fields. However, I found out that when I include PHP (ex. <?php the_field(‘field_name’);?>) in a custom field on the admin panel, the PHP only shows up as raw text on the front end page.

    To clarify, I want to be able to add PHP in the text areas of ACF on the admin panel and I want the PHP to work as such on the webpage. For example, this is the content of an ACF text area of the field name water_blog_post:

    <div class="<?php the_field('water_type'); ?>">
         <?php the_field('water_title'); ?>
         <?php the_field('water_description'); ?>
    </div>

    In this case, the PHP in the front end shows up as raw text, not PHP, but the HTML works fine. I see there is an option to enable HTML, but not PHP, and what I want is to enable PHP so I can use PHP in an ACF field.

    Sorry if I sound confusing, it’s hard to explain ?? Let me know if I need to elaborate.

  • The topic ‘[Plugin: Advanced Custom Fields] Show PHP Content in Text Area’ is closed to new replies.