Can't assign the value of the_field() to a variable

后端 未结 1 495
死守一世寂寞
死守一世寂寞 2021-01-23 19:33

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.

1条回答
  •  执笔经年
    2021-01-23 20:10

    the_field(ACFfield); doesn't return anything. It just prints the filename out. Use get_field() instead, which will return the value.

    0 讨论(0)
提交回复
热议问题