Custom Field, IF & Require_Once
-
Hey All!
I have a bit of a PHP question about using an advanced custom field in a IF statement and then in a require_once.
Here is my issue…
I am using the following IF statement:
<?php if(get_field('CUSTOM_FIELD')) { echo '<p>' . get_field('CUSTOM_FIELD') . '</p>'; } ?>
However I would like to create a IF statement that will then trigger a require_once action that uses the custom field as the file name.
Example:
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/files/CUSTOM_FIELD.php'; ?>
Any guidance on this would be really appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Field, IF & Require_Once’ is closed to new replies.