Support » Themes and Templates » Gallery Post Format: Link with File

Gallery Post Format: Link with File

  • Hey Caroline,

    I am very happy with your theme, but now I am wondering, how to change the linking with your gallery template.
    The featured images are shown correctly, but when I click on them I am redirected to a new page, which displays the picture.

    Is there a way to link directly to the file? I’d like to use a lightbox plugin with this feature…


Viewing 1 replies (of 1 total)
  • Theme Author Caroline Moore


    Hi! Since the gallery in the Gallery post format uses specific settings, you can override them by copying the content-gallery.php template file into a child theme. Change the do_shortcode() function on line 11 to include the gallery features you want — for example, to link to the image (instead of the attachment page) you’d add this to the shortcode syntax:


    Read more about the shortcode and how to use it here:

    As to how to get it to work with a Lightbox plugin, that’s up to the plugin and how it handles WordPress galleries.

Viewing 1 replies (of 1 total)
  • The topic ‘Gallery Post Format: Link with File’ is closed to new replies.