我为bbpress添加了几个论坛,当显示根页面时,我会列出它们。现在,我想在顶部添加一些描述,为访问者提供一些指导。有人知道怎么做吗?
如何在bbpress根页面的论坛列表上添加描述
1 个回复
最合适的回答,由SO网友:Nicolai Grossherr 整理而成
一种可能性是bbp_template_before_forums_index
像这样:
add_action( \'bbp_template_before_forums_index\', \'wpse118937_bbpress_forum_list_desc\');
function wpse118937_bbpress_forum_list_desc() {
//add your description code here
}
这将显示在面包屑之后和列表之前。
如果您想要更广泛的自定义,您可以为此自定义模板,但不应该直接在插件文件夹中这样做,因为这将在更新时被覆盖。因此,在更改相应的模板文件之前,必须执行以下操作:
To customize bbPress: <目录“wp content/plugins/bbpress/templates/default/”包含目录“bbpress”、“css”、“extras”和“js”,以及文件“bbpress functions.php”。
“bbpress”目录包含模板部分。将它们中的任何一个复制到主题根目录中名为“bbpress”的目录中,使其看起来像:/wp content/themes/%your theme%/bbpress/
负责显示论坛列表的模板文件为content-archive-forum.php
.
结束