如何禁用 tumblr 主题中的 photoset [英] How to disable the photoset in tumblr theme
问题描述
我想禁用照片集,只在网格框中显示一张图片,我在 img 标签外使用了 {block:Photos}{/block:Photos},但是,它仍然不起作用,我不知道为什么.
代码:
{block:photoset}{块:照片}<img src="{PhotoURL-500}" border="0"/>{/块:照片}{块:标题}<div class="entry"><blockquote>{Caption}</blockquote>
{/block:标题}{/block:photoset}
如果您只想显示 Photoset 的第一张图片,您必须这样做:
HTML:
{block:Photoset}<div class="my-photoset">{块:照片}<img src="{PhotoURL-500}" border="0"/>{/块:照片}
{块:标题}<div class="entry"><blockquote>{Caption}</blockquote>
{/block:标题}{/block:Photoset}
CSS:
.my-photoset img {显示:无;}.my-photoset img:first-child {显示:块;}
您可以将类更改为您想要的任何内容,我只是将它们作为示例.您可能已经在主题中加入了一些课程.
I wanna disable the photoset and just show one image in the grid box,I used {block:Photos}{/block:Photos} outside img tag, however, it still doesn't work, I don't know why.
Code:
{block:photoset}
{block:Photos}
<img src="{PhotoURL-500}" border="0" />
{/block:Photos}
{block:Caption}
<div class="entry">
<blockquote>{Caption}</blockquote>
</div>
{/block:Caption}
{/block:photoset}
If you only want to show the first image of a Photoset you'll have to do this:
HTML:
{block:Photoset}
<div class="my-photoset">
{block:Photos}
<img src="{PhotoURL-500}" border="0" />
{/block:Photos}
</div>
{block:Caption}
<div class="entry">
<blockquote>{Caption}</blockquote>
</div>
{/block:Caption}
{/block:Photoset}
CSS:
.my-photoset img {
display: none;
}
.my-photoset img:first-child {
display: block;
}
You can change the classes to be whatever you want them to be, I just put those in as an example. There may be classes that you can tie into in the theme already.
这篇关于如何禁用 tumblr 主题中的 photoset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!