这看起来很简单,但我无法让它发挥作用。我想要的只是显示一个存储为自定义字段的标题(它是 h3 标签)。我在代码中的另一个地方使用它并且它有效,但不在页脚中。ACF 是否仅在某些领域起作用,而在其他领域不起作用?
<footer class="section section--footer">
<div class="section--footer__header">
$post_id = get_queried_object_id();
<h3 class="text-white"><?php echo the_field("cta_field_title",$post_id);?></h3>
</div>
<form action="#" class="section--footer__form">
<div class="section--footer__input-box center">
<label for="name"></label>
<input type="text" id="name" placeholder="name" class="input">
<label for="email"></label>
<input type="text" id="email" placeholder="email address" class="input">
</div>
<div class="button__box center">
<a href="#" class="button">Submit</a>
</div>
</form>
<div class="section--footer__links">
<?php wp_nav_menu(array(
"theme_location" => "footer",
"menu" => "desktop",
"menu_class" => "section--footer__links"
)) ?>
<?php wp_nav_menu(array(
"theme_location" => "social",
"menu" => "desktop",
)) ?>
</div>
</footer>
<?php wp_footer() ?>
</body>
</html>
白猪掌柜的