Php Wordpress上的小枝-获取作者帖子名

Php Wordpress上的小枝-获取作者帖子名,php,wordpress,post,twig,author,Php,Wordpress,Post,Twig,Author,我正在使用一个基于名为Realia的细枝文件的wp模板。我正在使用buddypress,我想在帖子的作者简介中添加一个链接按钮。 我发现谁帮了我很多,但我想找到作者的名字,我找到的是身份证作者。有人能帮我吗 这是我的密码: <a href="/members/{{post.post_author}}">Envoyer un message au propriétaire</a> 我找到了一条路!非常感谢您的回复!: {% set id = post.post_

我正在使用一个基于名为Realia的细枝文件的wp模板。我正在使用buddypress,我想在帖子的作者简介中添加一个链接按钮。 我发现谁帮了我很多,但我想找到作者的名字,我找到的是身份证作者。有人能帮我吗

这是我的密码:

 <a href="/members/{{post.post_author}}">Envoyer un message au propriétaire</a>

我找到了一条路!非常感谢您的回复!:

    {% set id = post.post_author %}
    {% set author = wp.bp_core_get_username(id) %}
    <FORM ACTION="/members/{{author}}">
    <INPUT TYPE="SUBMIT" VALUE="Envoyer un message au propriétaire"></FORM> 

您是否已经尝试将href链接生成为{{post.author.link}}?是的,我尝试了,但它没有做任何操作。。它只是重定向到我尝试过的成员页面。post\u author\u name,post\u author name,post.post.author.name。。。但是没什么用,我只得到ID,没有名字..那{{post.author.name}呢?它也不起作用:/在wordpress上,php是。没有办法把它包括在细枝里?我是Twig模板的新手:/user属性没有按预期工作?你也试过{post.author.first_name}吗?