如何使用PHP从自定义邮政类型WordPress检索数据
并且在每列IE(持续时间,incall,outcall,outcall)下方显示的值遇到困难
我正在尝试显示表中插入自定义帖子类型的数据, 。
“ https://i.sstatic.net/gejz5.png” rel =“ nofollow noreferrer”>
<table class="rates-table">
<?php $get_rates_list = get_field('rates_optional');
if(get_rates_list){
foreach($get_rates_list as $rate){?>
<thead>
<tr>
<td><h3 class="inside-model-single">Duration</h3></td>
<td><h3 class="inside-model-single">Incall</h3></td>
<td><h3 class="inside-model-single">Outcall</h3></td>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td><span class="rate_value"><?php echo $rate['incall_1_hour'];?></span></td>
<td><span class="rate_value"><?php echo $rate['outcall_1_hour'];?></span></td>
</tr>
<?php }
}?>
</tbody>
</table>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是通过其
name
单独显示 get_field()或 the_field()。第二种方法是使用 get_fields()具体帖子。以下只是一个简单的例子,因为我不知道您帖子的完整结构。相应地进行更改。
One way is displaying by its
Name
individually using get_field() or the_field().Second way is using get_fields() to get an array of all field values for current or a specific post. Following is just a simple example as I don't know the full structure of your post. Make your changes accordingly.