Search code examples
htmlcsstumblr

Difference between LinkURL and Permalink at Tumblr


What is the difference? permalink seems to work perfectly.

<div class="tumblr-photo">
<a href="{permalink}"><img src="{PhotoURL-HighRes}" alt="{PhotoAlt}" /></a>

LinkURL generates my blog link. Only goes back to the front and not into the post.

<a href="{LinkURL}"><img src="{PhotoURL-HighRes}" alt="{PhotoAlt}" /></a>

Is there annything I am doing wrong or is it OK to use permalink? Tumblr said I was missing LinkOpenTag or LinkURL.


Solution

  • Click-through URLs for Tumblr's Photo Post Type

    Tumblr provides support for click-through URLs on Photo Posts ONLY. This allows the post creator to specify an alternative URL to visit when a user clicks the photo. If the post creator doesn't set a click-through it defaults to the permalink URL.

    How to add a click-through?

    When the user creates a photo post, hover the image and add the URL:

    enter image description here

    Here is example, live: http://mikedidthis-so.tumblr.com/

    Is it wrong?

    To answer the OPs question, it's not wrong, but I wouldn't advise it. You should never define the anchor yourself, let the theme variables take care of it.

    {LinkOpenTag}
    <img src="{PhotoURL-HighRes}" alt="{PhotoAlt}" />
    {LinkCloseTag}
    

    When the theme is parsed, depending on the theme options, it will also add target="_blank" to the generated anchor.

    Using {LinkURL}

    The variable {LinkURL} should be used to show the click-through link as an standalone anchor / text. Example:

    {block:LinkURL}
    <a href="{LinkURL}">Find out more here</a>
    {/block:LinkURL}
    

    Reference

    Photo Post Variables: https://www.tumblr.com/docs/en/custom_themes#photo-posts