假如您的樂多模版是使用
resnick的檔案,你可以修改模版裡的main.template
將原本的
{foreach from=$posts item=post}
<!-- show the whole post, as we would normally do -->
{assign var="postDate" value=$post->getDateObject()}
{if $prevDay != $postDate->getDay()}
<H2 class=date>{$locale->formatDate($postDate,"%B %d, %Y")}</H2>
{/if}
{assign var="prevDay" value=$post->getDay()}
{include file="$blogtemplate/post.template"}
{/foreach}
{/if}
改成
{foreach from=$posts item=post}
<!-- show the whole post, as we would normally do -->
{assign var="postDate" value=$post->getDateObject()}
{assign var="postDateValue" value=$locale->formatDate($postDate,"%B %d, %Y")}
{if $prevDayValue != $postDateValue}
<H2 class=date>{$locale->formatDate($postDate,"%B %d, %Y")}</H2>
{/if}
{assign var="prevDay" value=$post->getDateObject()}
{assign var="prevDayValue" value=$locale->formatDate($postDate,"%B %d, %Y")}
{include file="$blogtemplate/post.template"}
{/foreach}
{/if}
{pager style="links" previous="«上一頁" next="下一頁»"}
上面最後一行的pager是分頁功能
以上是
resnick教我的,感謝
resnick。