【发布时间】:2017-11-23 07:42:32
【问题描述】:
以下内容:
class="<?php the_field('icon','service-category_'.$term->term_id) ?>">
成功了:
class="icon-ico-1"
但是当我执行以下操作时:
<?php $iconpath = 'images/'.the_field('icon','service-category_'.$term->term_id).'.svg.php'; ?>
它不计算'icon-ico-1',而是给出以下路径:
images/.svg.php
这显然是不正确的。我希望它是:
images/icon-ico-1.svg.php
【问题讨论】:
-
日志中有错误吗?好像您在
the_field()函数未正确定义的地方使用它。这两个示例是同一个文件/同一个范围吗?
标签: php html wordpress string svg