Tumblr 主题照片 - 如何停止 link 放大图片和 link 永久link

Tumblr Theme photos - how to stop linking to larger image and link to permalink

你好:我有一个简单的主题,我认为这是一个简单的问题。在照片块中 - 我希望在单击转到 post 的 "permalink" 页面时显示图像,而不是将图像扩展到灯箱或显示图像。没有明显的 HREF 可以修改以转到永久链接 - 所以我迷路了。

来自固定链接页面 - 可以展开。我修改了所有变量,我可以完全关闭图像链接 - 但无法修改行为以将它们发送到永久链接。希望这是有道理的 - 并提前致谢。

完整代码也在这里:fullcode from theme

实际的 tumblr 是:bestofmoderndesign.tumblr.com

代码:

 {block:Photo}
                            <div class="media">
                                {LinkOpenTag}
                                    <img src="{block:PermalinkPage}{PhotoURL-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{PhotoURL-400}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoURL-500}{/block:If500pxPosts}{/block:IndexPage}" width="{block:PermalinkPage}{PhotoWidth-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoWidth-500}{/block:If500pxPosts}{/block:IndexPage}" height="{block:PermalinkPage}{PhotoHeight-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{PhotoHeight-400}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoHeight-500}{/block:If500pxPosts}{/block:IndexPage}" alt="{PhotoAlt}" />
                                {LinkCloseTag}
                                {block:IfEnableColorbox}
                                    <a href='{PhotoURL-HighRes}' class='fullsize colorbox' rel="fullsize"><span>{lang:Click for high-res photo}</span></a>
                                {/block:IfEnableColorbox}
                            </div>
                            {block:Caption}
                                <div class="copy">{Caption}</div>
                            {/block:Caption}
                        {/block:Photo}

{LinkOpenTag}{LinkCloseTag} 是生成 link 到大图像页面的原因。
改为使用 <a href='{Permalink}'></a>

如果您希望它在 permalink 页面上继续这种行为,您可以随时将代码更改为:

{block:Photo}
    <div class="media">
        {block:PermalinkPage}{LinkOpenTag}{/block:PermalinkPage}
        {block:IndexPage}<a href="{Permalink}">{/block:IndexPage}
            <img src="{block:PermalinkPage}{PhotoURL-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{PhotoURL-400}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoURL-500}{/block:If500pxPosts}{/block:IndexPage}" width="{block:PermalinkPage}{PhotoWidth-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoWidth-500}{/block:If500pxPosts}{/block:IndexPage}" height="{block:PermalinkPage}{PhotoHeight-500}{/block:PermalinkPage}{block:IndexPage}{block:IfNot500pxPosts}{PhotoHeight-400}{/block:IfNot500pxPosts}{block:If500pxPosts}{PhotoHeight-500}{/block:If500pxPosts}{/block:IndexPage}" alt="{PhotoAlt}" />
        {block:IndexPage}</a>{/block:IndexPage}
        {block:PermalinkPage}{LinkCloseTag}{/block:PermalinkPage}
        {block:IfEnableColorbox}
            <a href='{PhotoURL-HighRes}' class='fullsize colorbox' rel="fullsize"><span>{lang:Click for high-res photo}</span></a>
        {/block:IfEnableColorbox}
    </div>
    {block:Caption}
        <div class="copy">{Caption}</div>
    {/block:Caption}
{/block:Photo}

我重写了代码。由于您不希望它 link 成为高分辨率图像,我已将其完全删除,因此它会自动 link 直接进入 permalink 页面 {块:照片}

    <div class="media">
        {block:IndexPage}
            {block:IfNot500pxPosts}<a href="{Permalink}"><img src="{PhotoURL-400}"></a>{/block:IfNot500pxPosts}
            {block:If500pxPosts}<a href="{Permalink}"><img src="{PhotoURL-500}"></a>{/block:If500pxPosts}
        {/block:IndexPage}

        {block:PermalinkPage}<img src="{PhotoURL-500}">{/block:PermalinkPage}
    </div>
    {block:Caption}
        <div class="copy">{Caption}</div>
    {/block:Caption}
{/block:Photo}