问题
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