作者cheanch (cheanch)
看板Blog
标题[Blogger] 分享如何将同一天文章分开显示
时间Mon Oct 1 16:00:25 2012
好读无音乐图文版
http://ca-chen.blogspot.tw/2012/05/blog-post_19.html#more
在Blogger中我选的版型"顶尖企业",若是同一天发表两篇以上的文章
会全部连在同一个区块,较旧的文章会连在新文章的後面而且不会显示日期。
我不太清楚其他范本版型会不会有这样的情况,但我是不太喜欢这样的配置。
这点实在很困扰我,让我有时候同一天想发第二篇第三篇都要忍到隔天,
因为我实在不喜欢都黏在一起的区块阿阿阿阿阿阿阿!!!!!!!!
Blogger一个好用的地方就是什麽都有机会可以自己更改,
於是乎为了这个需求找了几天资料,顶多就是用script把日期显示出来,
但版型还是黏在一起阿阿阿阿阿阿!!!!!!
最後放弃用中文寻找,改用英文到google去搜寻,没想到第一篇就成功了,分享给跟我一
样不喜欢同一天文章黏在一起的同好。
------------------------------------------------------------------------------
修改范本分隔线修改范本分隔线修改范本分隔线修改范本分隔线修改范本分隔线修改范本
------------------------------------------------------------------------------
进入范本後修改HTML,展开小装置范本,搜寻以下片段
<!-- posts -->
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<data:defaultAdStart/>
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.isDateStart'>
<b:if cond='data:post.isFirstPost == "false"'>
</div></div>
</b:if>
</b:if>
<b:if cond='data:post.isDateStart'>
<div class="date-outer">
</b:if>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><span><data:post.dateHeader/></span></h2>
</b:if>
<b:if cond='data:post.isDateStart'>
<div class="date-posts">
</b:if>
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</b:loop>
<b:if cond='data:numPosts != 0'>
</div></div>
</b:if>
<data:adEnd/>
</div>
※在我的范本里是有两段 <!-- posts --> 小心不要选错了,找到之後把整段
直接改成下面这段
<!-- posts -->
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<data:defaultAdStart/>
<b:loop values='data:posts' var='post'>
<div class="date-outer">
<h2 class='date-header'><span><data:post.timestamp/></span></h2>
<div class="date-posts">
<div class='post-outer'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == "static_page"'>
<b:include data='post' name='comments'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>
</b:if>
</div>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<data:defaultAdEnd/>
<b:else/>
<data:adEnd/>
</b:if>
<div class='inline-ad'>
<data:adCode/>
</div>
<data:adStart/>
</b:if>
<b:if cond='data:post.trackLatency'>
<data:post.latencyJs/>
</b:if>
</div>
</div>
</b:loop>
<data:adEnd/>
</div>
※※※※重要※※※※
改完後到设定里面的语言格式将时间戳记改成想要的格式,这会替代原本的标题格式。
储存後预览一下吧!
贺!!!!!!!大功告成!!!!!!!
参考网址已於图文版内附上。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.45.188.96
1F:推 CCB7:实用推 10/03 23:59
2F:推 Akitsukineko:刚好在考虑要不要分段XD 10/05 01:36
3F:推 hipperlee:推实用!!! 10/06 02:44
4F:推 strellson:你的网志文章照片都超大的 10/07 14:01
5F:→ Wcw5504:看起来就是直接用时间戳记取代标题戳记 10/07 21:19
6F:推 daphnechiu:推~~感谢原po! 11/05 22:55
7F:→ chshyu:请问是否把时间戳记改成日期格式呢?看了语法有点雾杀杀 谢 11/23 20:59
8F:→ chshyu: ^有 11/23 21:00