Support

Account

Home Forums Add-ons Gallery Field linking to attachment page in place of the file itself

Solved

linking to attachment page in place of the file itself

  • Hello,

    I’m building a theme for my website using the ACF Gallery. I would like the link on picture to open attachment page, but it open the image file only. How should I force the theme to open the picture as attachment page ?

    Frederic

    • Elliot

    • December 11, 2013 at 10:42 am

    Hi @frederic_c

    The gallery field will return an array of images. Each image is itself an array containing lots of data such as ‘id’.

    You can use the id to find the attachment link like so:
    http://codex.wordpress.org/Function_Reference/get_attachment_link

    Thanks
    E

  • Great !!!
    Thank you, the problem was in fact more a codex/wordpress problem than an ACF one. thank you for getting me in the right direction 😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.