【发布时间】:2011-12-02 02:30:56
【问题描述】:
(这篇文章已在 Yootheme 论坛上提交,但我对解决方案没有那么大的信心,所以我想我也会在这里发布。)
我正在使用 Yoothemes 的 Nano 主题,它在我的 90% 的网站上运行良好。 http://dofekit.org 但是我刚刚安装了 bbPress 论坛插件(不是在实时站点上,而是在本地版本上)并且我创建了 2 个“论坛”。论坛索引页面和所有子页面似乎都插入到标准的 Nano 页面模板中。这不适合论坛,因为它包含页面元信息,而且我认为无法关闭论坛的“sidebar-a”,如我的屏幕截图所示。
http://dl.dropbox.com/u/240752/forums.jpg
有没有办法在 yoothemes 框架内为论坛帖子类型创建单独的模板? (我知道它是专有的,但我可以问)
谢谢。
更新:
我是其中的一部分。我已经设法为我的论坛帖子类型制作单独的模板,但我仍然需要在小部件设置中确认自定义帖子类型。
我在 warp/systems/wordpress3.0/layouts/content.php
中添加了自定义帖子类型if (is_home()) {
$content = 'index';
} elseif (is_page()) {
$content = 'page';
} elseif (is_attachment()) {
$content = 'attachment';
} elseif ((is_single()) && (get_post_type() == 'forum')) {
$content = 'forum-single';
}elseif ((is_single()) && (get_post_type() == 'topic')) {
$content = 'topic-single';
} elseif (is_single()) {
$content = 'single';
} elseif (is_search()) {
$content = 'search';
}elseif ((is_archive()) && (get_post_type() == 'forum')) {
$content = 'forum-archive';
} elseif (is_archive() && is_author()) {
$content = 'author';
} elseif (is_archive()) {
$content = 'archive';
} elseif (is_404()) {
$content = '404';
}
我还将这些自定义帖子类型添加到 warp/systems/wordpress3.0/config/layouts/fields/profile.php 为了让它们出现在每个小部件的下拉列表中。 (我希望能够在这些新的自定义模板上切换小部件。)
$defaults = array(
'home' => 'Home',
'archive' => 'Archive',
'search' => 'Search',
'single' => 'Single',
'page' => 'Pages',
'forum-archive' => 'Forum List',
'forum-single' => 'Forum Single',
'topic-single' => 'Topic Single'
);
有人可以帮忙吗?我想我快要完成了。
【问题讨论】:
-
“让自定义帖子类型在小部件设置中得到确认”到底是什么意思?这是您唯一的问题还是还有更多问题?老实说,“任何人都可以帮忙”不是最好的问题;)
标签: wordpress plugins themes bbpress