Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.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 ACF功能不显示_Php_Wordpress_Advanced Custom Fields - Fatal编程技术网

Php ACF功能不显示

Php ACF功能不显示,php,wordpress,advanced-custom-fields,Php,Wordpress,Advanced Custom Fields,我在每个WordPress页面的顶部添加了以下代码。但是,ACF PHP值不是从我创建的高级自定义字段中调用的 如何从运算符内部调用函数 [ux_slider label="destop" hide_nav="true" arrows="false" bullets="false"] [ux_banner height="100%" video_mp4="<?php the_fi

我在每个WordPress页面的顶部添加了以下代码。但是,ACF PHP值不是从我创建的高级自定义字段中调用的

如何从运算符内部调用函数

[ux_slider label="destop" hide_nav="true" arrows="false" bullets="false"]

[ux_banner height="100%" video_mp4="<?php the_field('bg_link'); ?>" video_visibility="visible"]

[text_box width="80" margin="100px 0px 0px 0px" position_x="10" position_y="35"]

[button text="$cta_1" color="white" style="outline" size="large" radius="1" expand="0" class="offersbutton"]

[button text="<?php the_field('CTA_2'); ?>" color="white" style="outline" size="large" radius="1" expand="0" class="offersbutton"]


[/text_box]

[/ux_banner]

[/ux_slider]
[ux\u滑块label=“destop”hide\u nav=“true”arrows=“false”子弹头=“false”]
[ux_banner height=“100%”video_mp4=“”video_visibility=“visible”]
[text_box width=“80”margin=“100px 0px 0px 0px”位置_x=“10”位置_y=“35”]
[按钮文本=“$cta_1”color=“white”style=“outline”size=“large”radius=“1”expand=“0”class=“offersbutton”]
[button text=”“color=“white”style=“outline”size=“large”radius=“1”expand=“0”class=“offersbutton”]
[/text\u框]
[/ux_横幅]
[/ux\u滑块]

使用名为Snippets的备用选项卡,我在html中注入了PHP字段,解决了这个问题。

为了更好地理解它,您将代码放在哪里以及如何在每个wordpress页面上运行?因为它看起来很奇怪,如果您试图在一个.php文件中使用短代码,那么您就缺少了“echo do_短代码”部分。相反,如果这是一些小部件/页面内容的内容,那么您的php代码将永远不会被执行(我想,如果有一些奇怪的插件在运行的话除外)@Diego使用页眉和页脚内部设置,有一个选项添加为“在页面内容之前”。我添加的短代码是我使用Flatsome主题生成器从页面本身获取的代码。你确定可以在“页眉和页脚设置”中编写PHP吗?问得好。我在它旁边找到了一个名为“Snippets”的替代选项卡,它允许我用PHP创建一个短代码,并将其注入html中。