给文章标题增加Permalinks
如果使用MT3.2的缺省模板,链接到单篇文章是通过"permalink"和"Continue reading..."来进入的,我们现在来增加一种新的方式:从文章标题直接链接进入。
1. 首先来定义一个样式。
先在你的样式表中找到.entry-header,如果你没有改过,大概应该是这样的:
.entry-header
{
margin-top: 0;
border-left: 5px solid #dae0e6;
padding: 0 0 0 10px;
color: #666;
font-size: 18px;
}
我们在下面增加一个链接的样式:
.entry-header a,
.entry-header a:link,
.entry-header a:visited
{
text-decoration: none;
color: #000;
}
.entry-header a:hover
{
color: #FF6600;
}
这是我用的,你可以改成你自己喜欢的样式,保存并重建你的styles-site.css。
2. 接下来要对主模板做一些修改。
在你的主模板代码中找到这一行:
<h3 class="entry-header"><$MTEntryTitle$></h3>
将其替换为:
<h3 class="entry-header"><a href="<$MTEntryPermalink archive_type="Individual"$>"><$MTEntryTitle$></a></h3>
保存并重建,看看效果吧。
Tags:

Comments
哈哈,我早就这样了,就连日期也是可以点到存档页面的
http://plod.popoever.com/archives/000281.html
Posted by: POPOEVER | 2005.11.18 - 00:30
HOHO~大大的站又开始更新啦,好好啊~
Posted by: s5s5 | 2005.11.18 - 04:40
:)
2.66的时候已经用了,现在边改边写出来,到时候也知道自己改了什么东西。
Posted by: sophoto | 2005.11.18 - 13:58
哈伊哈哈~~学习学习... ...
Posted by: seaspace | 2005.11.19 - 19:01