如何在MT4.0的标题边添加广告

| | Comments (1) | TrackBacks (0)

一个星期前ikias留言问,如何在MT的标题边添加广告,今天就来说明一下,我是怎样做的。

我介绍的方法,适用于MovableType4.0,如果你用的是其它的版本,请自己适当的修改。


这个主要是要修改两个地方,一个是header模板,一个是CSS文件。

在Template Modules中,打开header模板,找到下面的代码,

<div id="header-content">
<MTIf name="main_index">
<h1 id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2 id="header-description"><$MTBlogDescription$></h2>
<MTElse>
<div id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></div>
<div id="header-description"><$MTBlogDescription$></div>
</MTIf>
</div>

替换为如下的代码,

<div id="header-content">
<div id="header-left">
<MTIf name="main_index">
<h1 id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2 id="header-description"><$MTBlogDescription$></h2>
<MTElse>
<div id="header-name"><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></div>
<div id="header-description"><$MTBlogDescription$></div>
</MTIf>
</div>
<div id="header-right">
<!-- 这里放你的广告代码 -->
</div>
</div>
记得,在上面把你的广告代码放在里面,这里我的设计是468X60的Banner,在顶部我觉得不适合放太大的,就放这种展示广告好了。

下面是关于CSS的修改。

在Index Templates中,打开stylesheet-main模板,

在最后添加下面的代码

#header-left{
width: 410px;
display: inline;
float: left;
}

#header-right{
width: 510px;
display: inline;
float: left;
padding-bottom: 20px;
}

这样就好了,重建你的Blog,就可以像我这样把广告,或者其他的自己喜欢的Banner放在那里了。

作者: David Yin
原载: SEO 网站优化推广
版权所有。转载时必须以链接形式注明作者和及本声明。

Categories


Add this post to Delicious. Add this post to Furl. Add this post Yahoo My Web. Add this post Google Bookmarks. Add this post Blinklist. Add this post Blogmarks. Add this post Technorati. Add this post Digg. Add this post Windows Live. Add this post Netscape. Add this post Newsvine. Add this post ma.gnolia. Add this post Tailrank.

相关的文章

0 TrackBacks

Listed below are links to blogs that reference this entry: 如何在MT4.0的标题边添加广告.

TrackBack URL for this entry: http://seo.g2soft.net/mt-cgi/mt-tb-trackback.cgi/1879

1 Comments

ikias Author Profile Page said:

多谢介绍。

Leave a comment

订阅SEO 网站优化推广



小玩意儿

View blog authority
Add to Technorati Favorites

Listed on BlogShares


Marketing & SEO Blogs - Blog Top Sites


My blog is worth $68,309.34.
How much is your blog worth?