I inserted a metadata section on my Tumblr theme but it's not showing up. Is there anyway I can fix that?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 21:05:19

问题


This is the code I have.

{block:Date}
<section class="metadata">
<ul class="index">
<li>Date Posted: <a href="{Permalink"><time datetime="{MonthNumberWithZero}-{DayOfMonthWithZero}-{Year}">{Month} {DayOfMonth}, {Year}</time></a></li>

{block:ContentSource}
<li>{lang:Source}:<a href="{SourceURL}">{block:NoSourceLogo}{SourceTitle}{/block:NoSourceLogo}
{block:SourceLogo}<img src="{BlackLogoURL}" width="{LogoWidth}"height="{LogoHeight}" alt="{SourceTitle}" />{/block:SourceLogo}</a></li>
{/block:ContentSource} 

{block:NoteCount}<li><a class="notecount" href="{Permalink}#notes">{NoteCountWithLabel}</a></li>{/block:NoteCount}

</ul>
</section>
{/block:Date}

And here is my Tumblr theme.

http://lt-colbylovesamanda.tumblr.com/

Is it me or does Tumblr miss that sometimes?


回答1:


NoteCount / NoteCountWithLabel

The block {block:NoteCount} will only render if post has a note count higher than zero. If the count is zero, the block isn't rendered.

However, its possible to render the string 0 Notes. To achieve this, simply remove the block and use the variable {NoteCountWithLabel}.

If you move the outer blocks <li> will render, and include a note count regardless:

{block:Date}
<section class="metadata">
<ul class="index">
<li>Date Posted: <a href="{Permalink"><time datetime="{MonthNumberWithZero}-     
{DayOfMonthWithZero}-{Year}">{Month} {DayOfMonth}, {Year}</time></a></li>

<li><a class="notecount" href="{Permalink}#notes">{NoteCountWithLabel} 
</a></li>

</ul>
</section>
{/block:Date}

Ref: http://www.tumblr.com/docs/en/custom_themes#notes



来源:https://stackoverflow.com/questions/15957447/i-inserted-a-metadata-section-on-my-tumblr-theme-but-its-not-showing-up-is-the

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!