![]() |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
IP: 114.238.4.59
|
|||
|
|||
|
留言板包括两个部分, 即话题和评论. 话题部分可以是静态内容, 而评论需要借用 WordPress 的. 我们可以创建一个 page, 以 page 内容作为留言板话题, 并将该页面设为网站首页, 其他不可用链接全部转跳首页.
制作这个 WordPress 主题, 我们只需要 3 个文件: style.css, index.php, comments.php. 当 page.php 文件不存在时, page 会调用 index.php 作为它的模板. 以下是我的 index.php 文件内容. Code:
<?php get_header(); ?>
留言板的话题和相关内容写在这里...
<?php
if(have_posts()) {
the_post();
comments_template('', true);
}
get_footer();
?>
最后我们还需要为 WordPress 设置一下首页的映射, 进入后台 Setting -> Reading, Front page displays 选择 A static page, 并将 Front page 设为之前创建的 page. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Install WordPress on IIS | topvip | Blog(博客)/Wiki(维客)/RSS/Cms | 1 | 2010-01-25 08:31 PM |
| 让wordpress首页显示特殊页面(flash首页等) | yahoo | Blog(博客)/Wiki(维客)/RSS/Cms | 0 | 2009-02-25 06:58 AM |
| 备份wordpress数据库的七种方法 | car | WordPress | 0 | 2008-11-15 11:12 PM |
| wordpress 搜索引擎优化的二十条实用技巧 | car | 搜索引擎优化 | 0 | 2008-03-11 08:33 AM |
| WordPress 中文包 | sunshine | Blog(博客)/Wiki(维客)/RSS/Cms | 0 | 2007-03-12 10:16 AM |