Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP中使用短代码_Php_Html_Wordpress - Fatal编程技术网

在PHP中使用短代码

在PHP中使用短代码,php,html,wordpress,Php,Html,Wordpress,我试图插入短代码[acf field=“my_map”]和[acf field=“links”]来代替下面代码中显示的$html字符串中的_字段(“my_map”)和_字段(“links”)。显然,我对PHP的理解不够,无法让它正常工作。请帮忙 <?php if ( function_exists( 'wpmudev_ppw_html' ) ) { $html = '<div class="row top-spacer"><div class="col-md-8">

我试图插入短代码[acf field=“my_map”]和[acf field=“links”]来代替下面代码中显示的$html字符串中的_字段(“my_map”)和_字段(“links”)。显然,我对PHP的理解不够,无法让它正常工作。请帮忙

<?php
if ( function_exists( 'wpmudev_ppw_html' ) ) {
$html = '<div class="row top-spacer"><div class="col-md-8"><img class="img-responsive img-thumbnail" src="'.the_field('macro_map').'" /></div><div class="col-md-4"><h5><?php the_title(); ?>Resource Links</h5>'.the_field('symbol_news_links').'</div></div>'; // html code to be protected (required)
$id = 1; // An optional unique id if you are using the function more than once on a single page
$description = 'video'; // Optional description of the protected content
$price = '1.50'; // Optional price for a single view. If not set, price set in the post will be applied. If that is not set either, Unit Price in the Global Settings will be used.
echo wpmudev_ppw_html( $html, $id, $description, $price );
}
?>


'替换
。\u title()。

那么,你的问题是什么?无论我尝试使用哪种方法插入短代码,我都会遇到语法错误。所以我不能把经期和撇号放在正确的位置?我还必须改变_字段来得到_字段,因为我使用的是ACF。