Blogger中,只要点击一个标签,或者搜索文章的话,出来的结果都是全篇的文章,打开的时候很影响速度,而且很繁杂,用下面这个代码,可以优化一下,只在主页显示整幅文章,搜索、结果、标签、和第二页文章中,都只显示标题。
第一步,在“修改HTML”中,查找到这部分代码。
<b:widget id='Blog1' locked='false' title='Blog Posts' type='Blog'>
<b:includable id='main' var='top'>
<!-- posts -->
<div id='blog-posts'>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>
</b:if>
</b:loop>
</div>
第二步,将上面红色部分的代码,替换成蓝色的。
<b:if cond='data:blog.homepageUrl !=data:blog.url'><b:if cond='data:blog.pageType != "item"'><a expr:href='data:post.url'><data:post.title/></a><br/><br/><b:else/><b:include data='post' name='post'/></b:if><b:else/><b:include data='post' name='post'/></b:if>
沒有留言:
發佈留言
笔者非专业IT人员,仅仅是业余IT爱好者;
本博客转载皆注明出处,各位如果想转载也请注明出处;
有其他任何的问题,请联系此电邮xyjswf@gmail.com。
I'm not a professional IT staff,only an amateur enthusiasts;
Reproduced in this blog are marked with the source, that if you want to reprint please indicate the source;
Have any other question,please relate to this email xyjswf@gmail.com.