制作一个自定义 Tumblr 主题,其中混合了常见的 Tumblr 帖子类型(文本、图片、链接等)。
我还想偶尔做一个特殊的帖子类型,以展示我的摄影作品,但我不希望调整它的大小,而是想以高分辨率的全宽度展示照片主题(约 1140 像素宽)。
我读过有关 {block:HighRes} {/block:HighRes} 的内容,但这似乎是为了让 500px 图像点击进入原始图像。
有没有办法禁用这些特定特色摄影帖子的自动调整大小?也许是一种根据帖子标签改变行为的方法? (例如,如果它有“#photography”标签,则以全分辨率显示 - 如果没有,请继续并将大小调整为 500 像素宽)。
这是我正在尝试做的事情的直观示例:https://i.stack.imgur.com/tw8Je.jpg https://i.stack.imgur.com/tw8Je.jpg
您可以使用{TagsAsClasses}
例如对于这个汤不热标记:
{block:Posts}
<div class="entry {TagsAsClasses}">
Post Content
</div>
{/block:Posts}
以及 3 个带有此标签的帖子:
- 照片,高分辨率照片
- 照片,低分辨率照片
- 照片、摄影
Tumblr 输出这样的html标记:
<div class="entry photo photo-hi-res">
Post Content
</div>
<div class="entry photo photo-low-res">
Post Content
</div>
<div class="entry photo photography">
Post Content
</div>
这个标记可以用小的来处理css:
/* common for photo posts */
.entry.photo {}
/* `hi-res`-tag photo posts */
.entry.photo-hi-res {}
/* `low-res`-tag photo posts */
.entry.photo-low-res { width: 500px; }
/* `photography`-tag photo posts */
/* the rule you need */
.entry.photography { width: 900px; }
.entry.photography img { width: 100%; }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)