简体   繁体   中英

Wordpress: ACF custom field in PHP include

I couldn't find any help on Google but also because I don't really know how to address this issue in English.

I'm working on a WP theme with Advanced Custom Fields. I need one of the php includes on the page to be a custom field.

How do I do this? I tried this but it doesn't work? I am no expert in this..

<?php $search_form = get_field( 'search_template_include', 'option' ); ?>
<?php include('$search_form'); ?>

我花了将近一个小时,但是这位PHP noobie自己找到了答案

<?php include( get_field( "search_template_include", "option" ) ); ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM