将ACF自定义字段插入到WordPress注释中

问题描述 投票:0回答:1

我创建了这样的简码:

function lijst_reacties(){
comments_template(); 
}
add_shortcode('reacties','lijst_reacties');

但是它显示了我需要的一切,除了我需要在author名称之后添加一个自定义字段。自定义字段称为beroepsfunctie。如何在作者姓名后插入这个?

php wordpress filter comments hook
1个回答
0
投票

我建议创建您自己的评论模板。该模板应名为comments.php,并存在于主题目录的根目录中。这样,当您调用comments_template();时,它将从您的自定义模板中提取。

如果要有多个注释模板,则可以创建另一个注释模板,然后像comments_template('comments-custom.php');这样调用该函数>

这里是主题开发人员手册https://developer.wordpress.org/themes/template-files-section/partial-and-miscellaneous-template-files/comment-template/中“注释模板”部分的链接>

© www.soinside.com 2019 - 2024. All rights reserved.