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 :P Let me know if I need to elaborate.
Goal: (was told PHP in text area was bad idea)
I would like to be able to add content as I go while being able to use custom fields in the new content. For example, in ACF, there is a function where you can add / delete content as you go called a 'flexible field' but it is a premium feature. My work around solution was to just add / delete content via the text areas; however, the problem I encountered was that I needed to be able to include ACF content fields in the text area, so it would not run.