如果帖子在 tumblr 上是私有(private)的,我想在页面上添加一个“私有(private)”图像。有什么办法可以找出来吗?
最佳答案
我在 theming guide 中找不到任何变量, 因此似乎无法使用特殊的 class
或 id
值。
如果你可能喜欢编程,你可以(我不太了解这些东西)使用 the API它知道“state”:
Indicates the current state of the post
States are
published
,queued
,draft
andprivate
另一种(相当肮脏的)方法可能是使用 JavaScript 解析 URL 路径,因为私有(private)帖子以 /private/
开头。如果存在,您可以使用 JS 将 class
值(如“private”)添加到 body
元素。
关于html - 查看帖子是否在 tumblr 上是私有(private)的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13167315/