问题
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}
回答1:
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.
来源:https://stackoverflow.com/questions/13627465/how-to-disable-the-photoset-in-tumblr-theme