Tumblr:显示邮政编号

时间:2015-02-23 01:16:50

标签: css tumblr

我第一次修补Tumblr主题,我想知道是否有办法显示帖子的数量。第一个帖子是#1,第二个帖子是#2,依此类推?

这可能吗?

1 个答案:

答案 0 :(得分:0)

可悲的是,没有主题运算符会打印出当前的帖子号码,因为Tumblr不支持这种逻辑/功能。

但是,你可以假装它:

<强> CSS

.post:nth-child( 1 ) .number:after {
  content: ' 1';
}
.post:nth-child( 2 ) .number:after {
  content: ' 2';
}
.post:nth-child( 3 ) .number:after {
  content: ' 3';
}
.post:nth-child( 4 ) .number:after {
  content: ' 4';
}
.post:nth-child( 5 ) .number:after {
  content: ' 5';
}

<强> HTML

  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>
  <div class="post">
    <p class="number">Post</p>
  </div>

结果 http://jsbin.com/kahisiqipe