简体   繁体   English

如何在所有页面上显示一个ACF字段

[英]How to show one ACF field on all pages

Right now one this certain ACF is only displayed on the user end of the relevant page where generated ACF editor appears. 现在,此特定ACF仅显示在相关页面的用户端,其中显示了生成的ACF编辑器。

What I want to do is make a 'global' ACF, featured in certain php include that will appear on most of the pages in my template. 我想做的是制作一个“全局” ACF,该功能在某些php include中会出现在模板的大多数页面上。

How do I achieve this? 我该如何实现?

The only way I can achieve this effect is disregard my include, recode each page where I want that global ACF to appear, and then make sure ACF editor appears on each page in wp-admin, which isn't very graceful. 我能达到这种效果的唯一方法是无视我的include,重新编码要在其中显示该全局ACF的每个页面,然后确保ACF编辑器出现在wp-admin的每个页面上,这不是很正常。

Thanks in advance. 提前致谢。

I also had the same issue too. 我也有同样的问题。 If you still need a solution (or for those who still need an answer) ACF have released a premium add-on called "Options" ACF Options . 如果您仍然需要解决方案(或对于仍然需要答案的人),ACF会发布一个称为“ Options”的高级附加组件ACF Options

This will allow global use of custom fields. 这将允许全局使用自定义字段。 Check out the video tutorial on the page to customize the sidemenu for grouped global content. 请查看页面上的视频教程,以自定义针对分组的全局内容的菜单。

<?php the_field('field_name', 'option'); ?> <?php the_field('field_name', 'option'); ?> will call the content of that particular field. <?php the_field('field_name', 'option'); ?>将调用该特定字段的内容。

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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