高级自定义字段:显示为子弹点
我有一个在WordPress中创建的自定义复选框字段,用户可以在列出的属性中选择可用的各种设施。
我正在使用Elementor构建页面模板。
当我从ACF导入数据时,它显示为逗号分隔列表。
有什么办法可以将其显示为项目符号列表?
I have a custom checkbox field created in Wordpress where the user can select various facilities available at a listed property.
I am building a page template using Elementor.
When I import the data from ACF, it displays as a comma separated list.
Is there any way I can instead get this to display as as a bulleted list?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个代码,可以从ACF作为项目符号列表获取输出数据 -
我希望这就是您想要的。
Here is a code to get the output data from ACF as a bulleted list -
I hope this is what you are looking for.
您可以尝试使用一个插件,该插件可以创建PHP代码段,并使用诸如此类的快捷代码运行: https://it.wordpress.org/plugins/insert-php/
创建了PHP片段后,您可以尝试使用Elementor的快捷代码窗口窗口使用快速代码来运行它。
You could try using a plugin that let's you create php code snippets and run them with a shortcode such as this: https://it.wordpress.org/plugins/insert-php/
Once you created the php snippet you could try to run it with a shortcode using Elementor's shortcode widget.
我会稍微调整Tahmid的出色答案。为了允许空行(无子弹)在you
functions.php
文件中使用此信息:使用
acf_bullets调用此('your-fieldname-here'here');
dixplisation
$ format_acf_bulltets
:< ul>
列表< li></li>
< ul>
完整列表内容应用于字符串中变量
$ result
并在最后返回。练习使班级名称theme-ul
acf_bullets
的参数I'd slightly adjust Tahmid's excellent answer. In order to allow for empty lines (without a bullet) use this in you
functions.php
file:Call this with
acf_bullets('your-fieldname-here');
Explanation
$format_acf_bulltets
for the specific field that:<ul>
list<li></li>
<ul>
The complete list content is appended in string variable
$result
and returned at the end. As exercise make the class nametheme-ul
a parameter foracf_bullets