Can't assign the value of the_field() to a variable
问题 I'm using Advanced Custom Fields in Wordpress. I have a file path in a field (say "submenu/abc.php" in field "ACFfield"). I want to include that info on a webpage. If I do: <?php include "submenu/abc.php" ?> This works fine. But I need to do something like: <?php $file = the_field(ACFfield); include($file); ?> This, however just prints out "submenu/abc.php", from the first line (which I wouldn't want visible anyway). What am I doing wrong? 回答1: the_field(ACFfield); doesn't return anything. It