注
我知道有another post在這個題目。不幸的是我找不到解決方案。所以我再次問這個問題。WordPress的 - get_comment_author()返回 「匿名」 爲作者姓名
形勢
由被不回報「無名氏」記錄爲作者姓名用戶的評論。即使填寫了評論表單中的相應字段。
代碼
這是怎樣的作者名稱顯示(從functions.php
)
<?php
/* translators: 1: comment author url, 2: comment author name, 3: comment permalink, 4: comment date/timestamp*/
printf(__('%2$s schrieb am %4$s', 'buddypress'), get_comment_author_url(), get_comment_author(), get_comment_link(), get_comment_date());
?>
文件可能會有所幫助:
- /可溼性粉劑內容/主題/ mytheme的/ functions.php
- /wp-content/themes/mytheme/comments.php
- /可溼性粉劑包含/ comment-template.php
我真的不知道如何甚至會找問題。 我從閱讀StackOverflow的類似問題的猜測是,我必須將評論ID傳遞給get_comment_author()。但在這種情況下,我不知道如何做到這一點。
任何幫助非常感謝!謝謝!
你嘗試使用全局變量數組設置和訪問評論ID? $ GLOBALS [「comment_id」] =無;然後訪問它$ commentID = $ GLOBALS [「comment_id」]; – brad