類似其他的論壇,帖子的釋出者會帶有 「樓主」 標識。
轉載自薇曉朵技術論壇。
將下面的程式碼片段新增到已啟用主題的 functions.php
檔案即可:
//添加楼主和非楼主角色 function bbp_post_starter( $args = '' ) { $topic_author = bbp_get_topic_author_id(); $reply_author = bbp_get_reply_author_id( $reply_id ); if ( bbp_is_single_user_replies() ) { } elseif ( $reply_author === $topic_author ) { ?> <span class="post-starter-bq"> 楼主</span> <?php } } add_filter('bbp_theme_after_reply_author_details', 'bbp_post_starter');