How to disable the photoset in tumblr theme

穿精又带淫゛_ 提交于 2019-12-11 18:30:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!